-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathapp_db.sql
More file actions
35 lines (26 loc) · 856 Bytes
/
Copy pathapp_db.sql
File metadata and controls
35 lines (26 loc) · 856 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
create extension "uuid-ossp";
-- public.posts definition
-- Drop table
-- DROP TABLE public.posts;
CREATE TABLE public.posts (
id uuid NOT NULL DEFAULT uuid_generate_v4(),
title varchar NOT NULL,
"content" varchar NOT NULL,
created_at timestamp NOT NULL DEFAULT now(),
updated_at timestamp NOT NULL DEFAULT now(),
CONSTRAINT "PK_2829ac61eff60fcec60d7274b9e" PRIMARY KEY (id)
);
-- public.users definition
-- Drop table
-- DROP TABLE public.users;
CREATE TABLE public.users (
id uuid NOT NULL DEFAULT uuid_generate_v4(),
first_name varchar NULL,
last_name varchar NULL,
keycloak_id varchar NULL,
email varchar NOT NULL,
created_at timestamp NOT NULL DEFAULT now(),
updated_at timestamp NOT NULL DEFAULT now(),
CONSTRAINT "PK_a3ffb1c0c8416b9fc6f907b7433" PRIMARY KEY (id),
CONSTRAINT "UQ_97672ac88f789774dd47f7c8be3" UNIQUE (email)
);