Whitelist-API/API/docker-entrypoint-sql/init-user-db.sql
2023-10-24 01:37:34 -05:00

18 lines
407 B
SQL
Executable File

CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
CREATE USER api WITH LOGIN PASSWORD 'api';
CREATE DATABASE api OWNER api;
GRANT ALL PRIVILEGES ON DATABASE api TO api;
\connect api api;
CREATE TABLE IF NOT EXISTS roles (
id PRIMARY KEY DEFAULT uuid_generate_v4()
title varchar(40),
summary varchar(160),
content text,
published date,
updated date,
tags varchar(10)[],
UNIQUE(title)
);