-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate.sql
More file actions
131 lines (114 loc) · 4.01 KB
/
Copy pathcreate.sql
File metadata and controls
131 lines (114 loc) · 4.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
create table if not exists user_info (
id int primary key not null auto_increment,
email varchar(128) not null,
password varchar(128) not null,
nickname varchar(128) not null,
sex int not null default 0,
birthday date,
city varchar(128),
status int not null default 1,
hometown varchar(128),
school varchar(128),
private_set int not null default 1,
photo varchar(128),
intro varchar(128),
register_time timestamp not null default CURRENT_TIMESTAMP
)DEFAULT CHARSET=utf8;
create table if not exists friends (
id int primary key not null auto_increment,
user_id int not null,
friend_id int not null,
group_id int,
comment varchar(128)
)DEFAULT CHARSET=utf8;
create table if not exists friends_group (
id int primary key not null auto_increment,
user_id int not null,
group_name varchar(128) not null
)DEFAULT CHARSET=utf8;
create table if not exists add_friend_msg (
id int primary key not null auto_increment,
user_id int not null,
send_user_id int not null,
send_time timestamp not null default CURRENT_TIMESTAMP,
status int not null default 1,
content varchar(255)
)DEFAULT CHARSET=utf8;
create table if not exists short_messages (
id int primary key not null auto_increment,
send_user_id int not null,
receive_user_id int not null,
send_time timestamp not null default CURRENT_TIMESTAMP,
content varchar(255) not null,
status int not null default 1
)DEFAULT CHARSET=utf8;
create table if not exists visit_record (
id int primary key not null auto_increment,
user_id int not null,
friend_id int not null,
time timestamp not null default CURRENT_TIMESTAMP
)DEFAULT CHARSET=utf8;
create table if not exists blog (
id int primary key not null auto_increment,
user_id int not null,
category_id int not null,
title varchar(128) not null,
content text not null,
post_time timestamp not null default CURRENT_TIMESTAMP,
update_time timestamp not null
)DEFAULT CHARSET=utf8;
create table if not exists category (
id int primary key not null auto_increment,
user_id int not null,
category_name varchar(128) not null
)DEFAULT CHARSET=utf8;
create table if not exists photo (
id int primary key not null auto_increment,
user_id int not null,
album_id int not null,
path varchar(128) not null,
comment varchar(128)
)DEFAULT CHARSET=utf8;
create table if not exists album (
id int primary key not null auto_increment,
user_id int not null,
cover varchar(128) not null,
album_name varchar(128) not null
)DEFAULT CHARSET=utf8;
create table if not exists message (
id int primary key not null auto_increment,
user_id int not null,
poster_id int not null,
content varchar(128) not null,
post_time timestamp not null default CURRENT_TIMESTAMP
)DEFAULT CHARSET=utf8;
create table if not exists broadcast (
id int primary key not null auto_increment,
user_id int not null,
content varchar(255) not null,
post_time timestamp not null default CURRENT_TIMESTAMP
)DEFAULT CHARSET=utf8;
create table if not exists share (
id int primary key not null auto_increment,
user_id int not null,
content varchar(255)
)DEFAULT CHARSET=utf8;
create table if not exists review (
id int primary key not null auto_increment,
type int not null,
review_id int not null,
user_id int not null,
content varchar(255),
review_time timestamp not null default CURRENT_TIMESTAMP
)DEFAULT CHARSET=utf8;
create table if not exists review_type (
id int primary key not null auto_increment,
name varchar(128) not null
)DEFAULT CHARSET=utf8;
create table if not exists feed (
id int primary key not null auto_increment,
user_id int not null,
msg_type int not null,
event_msg varchar(255) not null,
create_time timestamp not null default CURRENT_TIMESTAMP
)DEFAULT CHARSET=utf8;