-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtables.sql
More file actions
32 lines (24 loc) · 797 Bytes
/
tables.sql
File metadata and controls
32 lines (24 loc) · 797 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
-- Active: 1663621767455@@35.226.146.116@3306@alves-andressa-darze
create table Labook_Users(
id varchar(255) primary key,
name varchar(255) not null,
email varchar(255) not null UNIQUE,
password varchar(255) not NULL,
role enum('NORMAL', 'ADMIN') default "NORMAL" not null
);
create table Labook_Posts(
id varchar(255) primary key,
content varchar(255) not null,
user_id varchar(255),
foreign Key (user_id) references Labook_Users(id)
);
create table Labook_Likes(
id varchar(255) primary key,
post_id varchar(255),
user_id varchar(255),
foreign key (post_id) references Labook_Posts(id),
foreign key (user_id) references Labook_Users(id)
);
select * from `Labook_Users`;
select * from `Labook_Posts`;
select * from `Labook_Likes`;