-
Notifications
You must be signed in to change notification settings - Fork 0
/
table.sql
46 lines (42 loc) · 1.03 KB
/
table.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
create table "user"
(
username varchar(63) not null
primary key,
password varchar(63),
name varchar(63),
email varchar(63)
);
create table "anime"
(
anime_id integer not null
primary key,
title varchar(63),
poster_image text,
rating double precision,
episode integer
);
create type status as enum ('WISHLIST', 'WATCHLIST', 'FINISHED');
create table "library"
(
library_id integer generated always as identity
primary key,
username varchar(63) not null
constraint library___fk
references "user",
anime_id integer not null
constraint library___fk2
references anime,
current_status status
);
create table "review"
(
review_id integer generated always as identity
primary key,
username varchar(63)
references "user",
anime_id integer
references anime,
anime_review text,
anime_score double precision,
review_date timestamp
);