This repository has been archived by the owner on Apr 17, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 252
/
setup.sql
232 lines (201 loc) · 5.5 KB
/
setup.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
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
--
-- Struct of table `cookies`
--
CREATE TABLE IF NOT EXISTS `cookies` (
`email` varchar(100) NOT NULL,
`password` varchar(100) NOT NULL,
`name` varchar(100) NOT NULL,
`hash` varchar(100) NOT NULL,
`cookie` varchar(500) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Struct of table `snapshots`
--
CREATE TABLE IF NOT EXISTS `snapshots` (
`tid` int(11) NOT NULL,
`starttime` datetime NOT NULL,
`endtime` datetime DEFAULT '0000-00-00 00:00:00',
`successcount` int(11) DEFAULT '0',
`failcount` int(11) DEFAULT '0',
`idchangedcount` int(11) DEFAULT '0',
`namechangedcount` int(11) DEFAULT '0',
`avatarchangedcount` int(11) DEFAULT '0',
`lasttid` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Struct of table `users`
--
CREATE TABLE IF NOT EXISTS `users` (
`tid` int(11) NOT NULL,
`hash` varchar(100) NOT NULL,
`id` varchar(100) NOT NULL,
`name` varchar(100) NOT NULL,
`sex` tinyint(1) DEFAULT NULL,
`avatar` varchar(100) DEFAULT NULL,
`signature` varchar(500) DEFAULT NULL,
`description` varchar(2000) DEFAULT NULL,
`location` varchar(100) DEFAULT NULL,
`business` varchar(100) DEFAULT NULL,
`employment` varchar(100) DEFAULT NULL,
`position` varchar(100) DEFAULT NULL,
`education` varchar(100) DEFAULT NULL,
`educationextra` varchar(100) DEFAULT NULL,
`cheat` tinyint(1) DEFAULT NULL,
`stopped` tinyint(1) DEFAULT NULL,
`hidden` tinyint(1) DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Struct of table `usersnapshots`
--
CREATE TABLE IF NOT EXISTS `usersnapshots` (
`tid` int(11) NOT NULL,
`sid` int(11) NOT NULL,
`uid` int(11) NOT NULL,
`ask` int(11) NOT NULL,
`answer` int(11) NOT NULL,
`post` int(11) NOT NULL,
`agree` int(11) NOT NULL,
`thanks` int(11) NOT NULL,
`follower` int(11) NOT NULL,
`followee` int(11) NOT NULL,
`fav` int(11) NOT NULL,
`logs` int(11) NOT NULL,
`mostvote` int(11) NOT NULL,
`mostvote5` int(11) NOT NULL,
`mostvote10` int(11) NOT NULL,
`count10000` int(11) NOT NULL,
`count5000` int(11) NOT NULL,
`count2000` int(11) NOT NULL,
`count1000` int(11) NOT NULL,
`count500` int(11) NOT NULL,
`count200` int(11) NOT NULL,
`count100` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Struct of table `usertopanswers`
--
CREATE TABLE IF NOT EXISTS `usertopanswers` (
`tid` bigint(20) NOT NULL,
`uid` int(11) NOT NULL,
`sid` int(11) NOT NULL,
`title` varchar(400) NOT NULL,
`agree` int(11) NOT NULL,
`date` datetime NOT NULL,
`answerid` varchar(20) NOT NULL,
`link` varchar(100) NOT NULL,
`ispost` tinyint(1) NOT NULL,
`collapsed` tinyint(1) NOT NULL,
`noshare` tinyint(1) NOT NULL,
`len` int(11) NOT NULL,
`imgcount` int(11) NOT NULL,
`summary` varchar(2000) CHARACTER SET utf8mb4 COLLATE = utf8mb4_unicode_ci NOT NULL,
`content` mediumtext CHARACTER SET utf8mb4 COLLATE = utf8mb4_unicode_ci NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Struct of table `wpdetail`
--
CREATE TABLE IF NOT EXISTS `wpdetail` (
`tid` int(11) NOT NULL,
`pid` int(11) NOT NULL,
`uid` int(11) NOT NULL,
`answerlink` varchar(100) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Struct of table `wpposts`
--
CREATE TABLE IF NOT EXISTS `wpposts` (
`tid` int(11) NOT NULL,
`date` date NOT NULL,
`publishtime` datetime NOT NULL,
`type` varchar(50) NOT NULL,
`postid` int(11) NOT NULL,
`pic` varchar(200) NOT NULL,
`excerpt` varchar(1000) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--
-- Indexes for dumped tables
--
--
-- Indexes for table `cookies`
--
ALTER TABLE `cookies`
ADD PRIMARY KEY (`hash`);
--
-- Indexes for table `snapshots`
--
ALTER TABLE `snapshots`
ADD PRIMARY KEY (`tid`);
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`tid`),
ADD UNIQUE KEY `idx_id` (`id`),
ADD UNIQUE KEY `idx_hash` (`hash`);
--
-- Indexes for table `usersnapshots`
--
ALTER TABLE `usersnapshots`
ADD PRIMARY KEY (`tid`),
ADD UNIQUE KEY `us` (`uid`,`sid`),
ADD KEY `sid` (`sid`);
--
-- Indexes for table `usertopanswers`
--
ALTER TABLE `usertopanswers`
ADD PRIMARY KEY (`tid`),
ADD UNIQUE KEY `index_link` (`link`),
ADD KEY `id` (`uid`,`sid`);
--
-- Indexes for table `wpdetail`
--
ALTER TABLE `wpdetail`
ADD PRIMARY KEY (`tid`),
ADD UNIQUE KEY `link` (`answerlink`),
ADD KEY `pid` (`pid`);
--
-- Indexes for table `wpposts`
--
ALTER TABLE `wpposts`
ADD PRIMARY KEY (`tid`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `snapshots`
--
ALTER TABLE `snapshots`
MODIFY `tid` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `tid` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `usersnapshots`
--
ALTER TABLE `usersnapshots`
MODIFY `tid` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `usertopanswers`
--
ALTER TABLE `usertopanswers`
MODIFY `tid` bigint(20) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `wpdetail`
--
ALTER TABLE `wpdetail`
MODIFY `tid` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `wpposts`
--
ALTER TABLE `wpposts`
MODIFY `tid` int(11) NOT NULL AUTO_INCREMENT;