-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDDL.sql
More file actions
64 lines (56 loc) · 1.18 KB
/
DDL.sql
File metadata and controls
64 lines (56 loc) · 1.18 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
55
56
57
58
59
60
61
62
63
64
CREATE SCHEMA usr;
CREATE SCHEMA video;
CREATE SCHEMA danmu;
create table usr.users(
mid bigint PRIMARY KEY,
name varchar(255),
sex varchar(10),
birthday varchar(20),
level int,
sign text,
identity varchar(20)
);
create table video.videos(
BV varchar(255) PRIMARY KEY,
title varchar(255),
owner_mid bigint,
commit_time timestamp,
review_time timestamp,
public_time timestamp,
duration interval,
description text,
reviewer bigint
);
create table danmu.danmu(
id bigserial PRIMARY KEY,
BV varchar(255) not null,
mid bigint,
time interval,
content text
);
create table usr.followings(
id bigserial PRIMARY KEY,
follower_id bigint not null,
followed_id bigint
);
create table video.likes(
id bigserial PRIMARY KEY,
who_likes bigint not null,
BV varchar(255)
);
create table video.coin(
id bigserial PRIMARY KEY,
who_coins bigint not null,
BV varchar(255)
);
create table video.favorite(
id bigserial PRIMARY KEY,
who_favorites bigint not null,
BV varchar(255)
);
create table video.view(
id bigserial PRIMARY KEY,
who_views bigint not null,
BV varchar(255),
last_time interval
);