-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbbs.sql
209 lines (93 loc) · 4.97 KB
/
bbs.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
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
CREATE DATABASE IF NOT EXISTS bbs;
use bbs;
create table IF NOT EXISTS t_user(
f_username char(50) not null primary key,
f_password char(50) not null,
f_name char(50) not null,
f_email char(50) not null,
f_logintimes int not null default 0,
f_lasttime datetime,
f_loginip char(19),
f_loginip int not null default 0
);
create table IF NOT EXISTS t_postinfo(
f_username char(50) not null primary key,
f_post_times int not null default 0,
f_reply_times int not null default 0,
f_enabled bool not null default true
);
create table IF NOT EXISTS t_board (
f_id int not null auto_increment primary key,
f_name char(16) not null,
f_desc varchar(200) not null,
f_created_time datetime not null,
f_enabled bool not null default true
);
create table IF NOT EXISTS t_article (
f_id int not null auto_increment primary key,
f_parent_id int not null default 0,
f_has_child bool not null default false,
f_title char(50) not null,
f_username char(50) not null,
f_board_id int not null,
f_post_time datetime not null,
f_ip char(19) not null,
f_enabled bool not null default true
);
create table IF NOT EXISTS t_article_content (
f_id int not null auto_increment primary key,
f_content text not null,
f_picture char(20) null
);
delete from t_user;
insert into t_user(f_username, f_password, f_name, f_email,f_tag)
values ('admin', md5('123456'), '管理员', '[email protected]',1);
insert into t_user(f_username, f_password, f_name, f_email,f_tag)
values ('bob', md5('123456'), '鲍伯', '[email protected]',0);
insert into t_user(f_username, f_password, f_name, f_email,f_tag)
values ('tom', md5('123456'), '汤姆', '[email protected]',0);
insert into t_user(f_username, f_password, f_name, f_email,f_tag)
values ('rose', md5('123456'), '罗丝', '[email protected]',0);
insert into t_user(f_username, f_password, f_name, f_email,f_tag)
values ('lily', md5('123456'), '丽丽', '[email protected]',0);
delete from t_postinfo;
insert into t_postinfo (f_uname, f_post_times, f_reply_times) values ('bob', 1, 1);
insert into t_postinfo (f_uname, f_post_times, f_reply_times) values ('tom', 1, 1);
insert into t_postinfo (f_uname, f_post_times, f_reply_times) values ('rose', 1, 1);
insert into t_postinfo (f_uname, f_post_times, f_reply_times) values ('lily', 1, 1);
insert into t_postinfo (f_uname, f_post_times, f_reply_times) values ('admin', 0, 0);
delete from t_board;
insert into t_board (f_id, f_name, f_desc, f_created_time)
values (1, '文艺沙龙', '文艺之事在此畅所欲言吧', now());
insert into t_board (f_id, f_name, f_desc, f_created_time)
values (2, '绿茵竞技', '绿茵赛场挥洒汗水', now());
delete from t_article;
insert into t_article (f_id, f_parent_id, f_has_child, f_title, f_username, f_board_id, f_post_time, f_ip)
values (1, 0, 1, '谈谈相声', 'bob', 1, now(), '192.168.0.1');
insert into t_article (f_id, f_parent_id, f_has_child, f_title, f_username, f_board_id, f_post_time, f_ip)
values (2, 1, 1, 're:谈谈相声', 'tom', 1, now(), '192.168.0.23');
insert into t_article (f_id, f_parent_id, f_has_child, f_title, f_username, f_board_id, f_post_time, f_ip)
values (3, 1, 0, 're:谈谈相声', 'rose', 1, now(), '192.168.0.22');
insert into t_article (f_id, f_parent_id, f_has_child, f_title, f_username, f_board_id, f_post_time, f_ip)
values (4, 2, 0, 're:re:谈谈相声', 'bob', 1, now(), '192.168.0.1');
insert into t_article (f_id, f_parent_id, f_has_child, f_title, f_username, f_board_id, f_post_time, f_ip)
values (5, 2, 0, 're:re:谈谈相声', 'lily', 1, now(), '192.168.0.67');
insert into t_article (f_id, f_parent_id, f_has_child, f_title, f_username, f_board_id, f_post_time, f_ip)
values (6, 0, 1, '谈谈小品', 'lily', 1, now(), '192.168.0.67');
insert into t_article (f_id, f_parent_id, f_has_child, f_title, f_username, f_board_id, f_post_time, f_ip)
values (7, 6, 0, 're:谈谈小品', 'bob', 1, now(), '192.168.0.1');
delete from t_article_content;
insert into t_article_content (f_id, f_content)
values(1, '出国了一段时间,回来后发现网上又有了新动向。...');
insert into t_article_content (f_id, f_content)
values(2, '顶');
insert into t_article_content (f_id, f_content)
values(3, '顶顶');
insert into t_article_content (f_id, f_content)
values(4, '顶顶顶');
insert into t_article_content (f_id, f_content)
values(5, '...此时,争辩这样的作品属于讽刺还是歌颂已经不重要了:他们共同献给你一个神清气爽的夜晚。...');
insert into t_article_content (f_id, f_content)
values(6, '...要承认...');
insert into t_article_content (f_id, f_content)
values(7, '顶顶顶顶');