-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdb-structure.sql
More file actions
37 lines (33 loc) · 1020 Bytes
/
db-structure.sql
File metadata and controls
37 lines (33 loc) · 1020 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
create table public.roles
(
id bigserial
constraint roles_pk
primary key,
name text not null,
user_id bigint
constraint roles_users_id_fk
references public.users
);
create table public.tasks
(
id bigserial
constraint tasks_pk
primary key,
name text not null,
is_done boolean default true not null,
creation_date timestamp default CURRENT_TIMESTAMP not null,
owner_id bigint not null
constraint tasks__fk
references public.users
);
create table public.users
(
id bigserial
constraint users_pk
primary key,
username text not null
constraint unique_constraint
unique,
password varchar(60) not null,
creation_date timestamp default CURRENT_TIMESTAMP not null
);