-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjavablog.sql
More file actions
45 lines (41 loc) · 1.01 KB
/
javablog.sql
File metadata and controls
45 lines (41 loc) · 1.01 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
create table if not exists user(
uid int primary key auto_increment,
username varchar(20) unique not null,
password text not null,
e_mail text not null
);
create table if not exists user_detail(
did int primary key auto_increment,
username varchar(20) unique,
dsex int,
dbirth date,
demail text,
dpage text,
foreign key(username) references user(username)
);
create table if not exists blog_content(
bid int primary key auto_increment,
username varchar(20),
btitle varchar(64),
bprivilege int not null,
bdate datetime,
bkind varchar(64),
bcontent mediumtext,
bclick int,
foreign key(username) references user(username)
);
create table if not exists blog_comment(
cmid int primary key auto_increment,
username varchar(64),
bid int,
cmcontent text,
cmreply text,
cmdate datetime,
foreign key(username) references user(username),
foreign key(bid) references blog_content(bid) on delete cascade
);
create table if not exists user_click(
username varchar(40) primary key,
uclick int,
foreign key(username) references user(username)
);