-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathtables.sql
More file actions
55 lines (51 loc) · 1.57 KB
/
tables.sql
File metadata and controls
55 lines (51 loc) · 1.57 KB
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
51
52
53
54
create table user
(
created_at datetime(6) null,
id bigint auto_increment
primary key,
modified_at datetime(6) null,
email varchar(255) null,
password varchar(255) null,
username varchar(255) null,
user_role enum ('ADMIN', 'USER') null,
constraint UKob8kqyqqgmefl0aco34akdtpe
unique (email)
);
create table todo
(
created_at datetime(6) null,
modified_at datetime(6) null,
todo_id bigint auto_increment
primary key,
user_id bigint not null,
contents varchar(255) null,
title varchar(255) null,
weather varchar(255) null,
constraint FK2ft3dfk1d3uw77pas3xqwymm7
foreign key (user_id) references user (id)
);
create table comment
(
comment_id bigint auto_increment
primary key,
created_at datetime(6) null,
modified_at datetime(6) null,
todo_id bigint not null,
user_id bigint not null,
contents varchar(255) null,
constraint FK8kcum44fvpupyw6f5baccx25c
foreign key (user_id) references user (id),
constraint FKj60kiatr37jebhtjaju6d5nv2
foreign key (todo_id) references todo (todo_id)
);
create table manager
(
id bigint auto_increment
primary key,
todo_id bigint not null,
user_id bigint not null,
constraint FKlx8n4x9vqj3lqv8cj9ienwrv6
foreign key (user_id) references user (id),
constraint FKquwlni4490qk12i1hiffa0evv
foreign key (todo_id) references todo (todo_id)
);