-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.sql
50 lines (46 loc) · 1.28 KB
/
init.sql
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
CREATE USER docker;
CREATE DATABASE docker;
GRANT ALL PRIVILEGES ON DATABASE docker TO docker;
create table users (
id serial primary key,
uuid varchar(64) not null unique,
firstName varchar(255),
lastName varchar(255),
email varchar(255) not null unique,
password varchar(255) not null,
created_at timestamp not null
);
create table goals (
id serial primary key,
uuid varchar(64) not null unique,
title varchar(255) not null,
color_tag varchar(64),
total_percent integer,
total_percent_completed integer,
completed boolean,
paused boolean,
deadline timestamp,
user_id integer references users(id),
created_at timestamp not null,
updated_at timestamp not null
);
create table tasks (
id serial primary key,
uuid varchar(64) not null unique,
title varchar(255) not null,
completed boolean,
deadline timestamp,
color_tag varchar(64),
user_id integer references users(id),
created_at timestamp not null,
updated_at timestamp not null
);
create table subtasks (
id serial primary key,
uuid varchar(64) not null unique,
title varchar(255) not null,
completed boolean,
task_id integer references tasks(id),
created_at timestamp not null,
updated_at timestamp not null
);