/
slashschema_create.sql
586 lines (542 loc) · 13.2 KB
/
slashschema_create.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
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
# MySQL dump 6.0
#
# Host: localhost Database: slashclean
#--------------------------------------------------------
# Server version 3.22.25-log
#
# Table structure for table 'accesslog'
#
CREATE TABLE accesslog (
id int(5) DEFAULT '0' NOT NULL auto_increment,
host_addr varchar(16) DEFAULT '' NOT NULL,
op varchar(8),
dat varchar(32),
uid int(1) DEFAULT '-1' NOT NULL,
ts datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
query_string varchar(50),
user_agent varchar(50),
PRIMARY KEY (id)
);
#
# Table structure for table 'authors'
#
CREATE TABLE authors (
aid char(30) DEFAULT '' NOT NULL,
name char(50),
url char(50),
email char(50),
quote char(50),
copy char(255),
pwd char(8),
seclev int(11),
lasttitle char(20),
section char(20),
deletedsubmissions int(11) DEFAULT '0',
matchname char(30),
PRIMARY KEY (aid)
);
#
# Table structure for table 'blocks'
#
CREATE TABLE blocks (
bid varchar(30) DEFAULT '' NOT NULL,
block text,
aid varchar(20),
seclev int(1),
type varchar(20) DEFAULT '' NOT NULL,
description text,
blockbak text,
PRIMARY KEY (bid),
KEY type (type)
);
#
# Table structure for table 'commentcodes'
#
CREATE TABLE commentcodes (
code int(1) DEFAULT '0' NOT NULL,
name char(32),
PRIMARY KEY (code)
);
#
# Table structure for table 'formkeys'
#
CREATE TABLE formkeys (
formkey varchar(20) DEFAULT '' NOT NULL,
formname varchar(20) DEFAULT '' NOT NULL,
id varchar(30) DEFAULT '' NOT NULL,
sid varchar(30) DEFAULT '' NOT NULL,
uid int(11) DEFAULT '-1' NOT NULL,
host_name varchar(30) DEFAULT '0.0.0.0' NOT NULL,
value int(1) DEFAULT '0' NOT NULL,
cid int(15) DEFAULT '0' NOT NULL,
ts int(12) DEFAULT '0' NOT NULL,
submit_ts int(12) DEFAULT '0' NOT NULL,
content_length int(4) DEFAULT '0' NOT NULL,
PRIMARY KEY (formkey),
KEY formname (formname),
KEY id (id),
KEY ts (ts),
KEY submit_ts (submit_ts)
);
#
# Table structure for table 'abusers'
#
CREATE TABLE abusers (
abuser_id int(5) DEFAULT '0' NOT NULL auto_increment,
host_name varchar(25) DEFAULT '' NOT NULL,
pagename varchar(20) DEFAULT '' NOT NULL,
ts datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
reason varchar(120) DEFAULT '' NOT NULL,
querystring varchar(60) DEFAULT '' NOT NULL,
PRIMARY KEY (abuser_id),
KEY host_name (host_name),
KEY reason (reason)
);
#
# Table structure for table 'commentmodes'
#
CREATE TABLE commentmodes (
mode varchar(16) DEFAULT '' NOT NULL,
name varchar(32),
description varchar(64),
PRIMARY KEY (mode)
);
#
# Table structure for table 'comments'
#
CREATE TABLE comments (
sid varchar(30) DEFAULT '' NOT NULL,
cid int(15) DEFAULT '0' NOT NULL,
pid int(15) DEFAULT '0' NOT NULL,
date datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
host_name varchar(30) DEFAULT '0.0.0.0' NOT NULL,
subject varchar(50) DEFAULT '' NOT NULL,
comment text NOT NULL,
uid int(1) DEFAULT '-1' NOT NULL,
points int(1) DEFAULT '0' NOT NULL,
lastmod int(1) DEFAULT '-1',
reason int(11) DEFAULT '0',
PRIMARY KEY (sid,cid),
KEY display (sid,points,uid),
KEY byname (uid,points),
KEY theusual (sid,uid,points,cid),
KEY countreplies (sid,pid)
);
#
# Table structure for table 'content_filters'
#
CREATE TABLE content_filters (
filter_id int(4) DEFAULT '0' NOT NULL auto_increment,
regex varchar(100) DEFAULT '' NOT NULL,
modifier varchar(5) DEFAULT '' NOT NULL,
field varchar(20) DEFAULT '' NOT NULL,
ratio float(6,4) DEFAULT '0.0000' NOT NULL,
minimum_match int(6) DEFAULT '0' NOT NULL,
minimum_length int(10) DEFAULT '0' NOT NULL,
err_message varchar(150) DEFAULT '',
maximum_length int(10) DEFAULT '0' NOT NULL,
PRIMARY KEY (filter_id),
KEY regex (regex),
KEY field (field)
);
#
# Table structure for table 'dateformats'
#
CREATE TABLE dateformats (
id int(1) DEFAULT '0' NOT NULL,
format varchar(32),
description varchar(64),
PRIMARY KEY (id)
);
#
# Table structure for table 'discussions'
#
CREATE TABLE discussions (
sid varchar(20) DEFAULT '' NOT NULL,
title varchar(128),
url varchar(128),
ts datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
PRIMARY KEY (sid)
);
#
# Table structure for table 'displaycodes'
#
CREATE TABLE displaycodes (
code int(1) DEFAULT '0' NOT NULL,
name char(32),
PRIMARY KEY (code)
);
#
# Table structure for table 'hitters'
#
CREATE TABLE hitters (
id int(5) DEFAULT '0' NOT NULL auto_increment,
host_addr varchar(15) DEFAULT '' NOT NULL,
hits int(6) DEFAULT '0' NOT NULL,
PRIMARY KEY (id),
KEY host_addr (host_addr),
KEY hits (hits)
);
#
# Table structure for table 'isolatemodes'
#
CREATE TABLE isolatemodes (
code int(1) DEFAULT '0' NOT NULL,
name char(32),
PRIMARY KEY (code)
);
#
# Table structure for table 'issuemodes'
#
CREATE TABLE issuemodes (
code int(1) DEFAULT '0' NOT NULL,
name char(32),
PRIMARY KEY (code)
);
#
# Table structure for table 'maillist'
#
CREATE TABLE maillist (
code int(1) DEFAULT '0' NOT NULL,
name char(32),
PRIMARY KEY (code)
);
#
# Table structure for table 'metamodlog'
#
CREATE TABLE metamodlog (
mmid int(11) DEFAULT '0' NOT NULL,
uid int(11) DEFAULT '0' NOT NULL,
val int(11) DEFAULT '0' NOT NULL,
ts datetime,
id int(11) DEFAULT '0' NOT NULL auto_increment,
PRIMARY KEY (id)
);
#
# Table structure for table 'moderatorlog'
#
CREATE TABLE moderatorlog (
id int(1) DEFAULT '0' NOT NULL auto_increment,
uid int(1) DEFAULT '0' NOT NULL,
val int(1) DEFAULT '0' NOT NULL,
sid varchar(30) DEFAULT '' NOT NULL,
ts datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
cid int(1) DEFAULT '0' NOT NULL,
reason int(11) DEFAULT '0',
PRIMARY KEY (id),
KEY sid (sid,cid),
KEY sid_2 (sid,uid,cid)
);
#
# Table structure for table 'newstories'
#
CREATE TABLE newstories (
sid varchar(20) DEFAULT '' NOT NULL,
tid varchar(20) DEFAULT '' NOT NULL,
aid varchar(30) DEFAULT '' NOT NULL,
commentcount int(1) DEFAULT '0',
title varchar(100) DEFAULT '' NOT NULL,
dept varchar(100),
time datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
introtext text,
bodytext text,
writestatus int(1) DEFAULT '0' NOT NULL,
hits int(1) DEFAULT '0' NOT NULL,
section varchar(15) DEFAULT '' NOT NULL,
displaystatus int(1) DEFAULT '0' NOT NULL,
commentstatus int(1),
hitparade varchar(64) DEFAULT '0,0,0,0,0,0,0',
relatedtext text,
extratext text,
PRIMARY KEY (sid),
KEY time (time),
KEY searchform (displaystatus,time)
);
#
# Table structure for table 'pollanswers'
#
CREATE TABLE pollanswers (
qid char(20) DEFAULT '' NOT NULL,
aid int(11) DEFAULT '0' NOT NULL,
answer char(255),
votes int(11),
PRIMARY KEY (qid,aid)
);
#
# Table structure for table 'pollquestions'
#
CREATE TABLE pollquestions (
qid char(20) DEFAULT '' NOT NULL,
question char(255) DEFAULT '' NOT NULL,
voters int(11),
date datetime,
PRIMARY KEY (qid)
);
#
# Table structure for table 'pollvoters'
#
CREATE TABLE pollvoters (
qid char(20) DEFAULT '' NOT NULL,
id char(35) DEFAULT '' NOT NULL,
time datetime,
uid int(11) DEFAULT '-1' NOT NULL,
KEY qid (qid,id,uid)
);
#
# Table structure for table 'postmodes'
#
CREATE TABLE postmodes (
code char(10) DEFAULT '' NOT NULL,
name char(32),
PRIMARY KEY (code)
);
#
# Table structure for table 'sectionblocks'
#
CREATE TABLE sectionblocks (
section varchar(30) DEFAULT '' NOT NULL,
bid varchar(30) DEFAULT '' NOT NULL,
ordernum tinyint(4) DEFAULT '0' NOT NULL,
title varchar(128),
portal tinyint(4) DEFAULT '0' NOT NULL,
url varchar(128),
rdf varchar(255),
retrieve int(1),
PRIMARY KEY (bid),
KEY bididx (bid),
KEY normalblocks (bid,portal,ordernum),
KEY normalsection (section,bid,portal,ordernum)
);
#
# Table structure for table 'sections'
#
CREATE TABLE sections (
section varchar(30) DEFAULT '' NOT NULL,
artcount int(11),
title varchar(64),
qid varchar(20) DEFAULT '' NOT NULL,
isolate int(1),
issue int(1),
extras int(11) DEFAULT '0',
PRIMARY KEY (section)
);
#
# Table structure for table 'sessions'
#
CREATE TABLE sessions (
session varchar(20) DEFAULT '' NOT NULL,
aid varchar(30),
logintime datetime,
lasttime datetime,
lasttitle varchar(50),
PRIMARY KEY (session)
);
#
# Table structure for table 'slashslices'
#
CREATE TABLE slashslices (
ssID int(11) DEFAULT '0' NOT NULL auto_increment,
ssRank int(11) DEFAULT '0' NOT NULL,
ssRUID int(11),
ssLayer text,
PRIMARY KEY (ssID,ssRank),
KEY rank (ssRank)
);
#
# Table structure for table 'sortcodes'
#
CREATE TABLE sortcodes (
code int(1) DEFAULT '0' NOT NULL,
name char(32),
PRIMARY KEY (code)
);
#
# Table structure for table 'statuscodes'
#
CREATE TABLE statuscodes (
code int(1) DEFAULT '0' NOT NULL,
name char(32),
PRIMARY KEY (code)
);
#
# Table structure for table 'stories'
#
CREATE TABLE stories (
sid varchar(20) DEFAULT '' NOT NULL,
tid varchar(20) DEFAULT '' NOT NULL,
aid varchar(30) DEFAULT '' NOT NULL,
commentcount int(1) DEFAULT '0',
title varchar(100) DEFAULT '' NOT NULL,
dept varchar(100),
time datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
introtext text,
bodytext text,
writestatus int(1) DEFAULT '0' NOT NULL,
hits int(1) DEFAULT '0' NOT NULL,
section varchar(15) DEFAULT '' NOT NULL,
displaystatus int(1) DEFAULT '0' NOT NULL,
commentstatus int(1),
hitparade varchar(64) DEFAULT '0,0,0,0,0,0,0',
relatedtext text,
extratext text,
PRIMARY KEY (sid),
KEY time (time),
KEY searchform (displaystatus,time)
);
#
# Table structure for table 'storiestuff'
#
CREATE TABLE storiestuff (
sid varchar(20) DEFAULT '' NOT NULL,
hits int(1) DEFAULT '0' NOT NULL,
PRIMARY KEY (sid)
);
#
# Table structure for table 'submissions'
#
CREATE TABLE submissions (
subid varchar(15) DEFAULT '' NOT NULL,
email varchar(50),
name varchar(50),
time datetime,
subj varchar(50),
story text,
tid varchar(20),
note varchar(30),
section varchar(30) DEFAULT '' NOT NULL,
comment varchar(255),
uid int(11) DEFAULT '-1' NOT NULL,
del tinyint(4) DEFAULT '0' NOT NULL,
PRIMARY KEY (subid),
KEY subid (subid,section)
);
#
# Table structure for table 'threshcodes'
#
CREATE TABLE threshcodes (
thresh int(1) DEFAULT '0' NOT NULL,
description char(64),
PRIMARY KEY (thresh)
);
#
# Table structure for table 'topics'
#
CREATE TABLE topics (
tid char(20) DEFAULT '' NOT NULL,
image char(30),
alttext char(40),
width int(11),
height int(11),
PRIMARY KEY (tid)
);
#
# Table structure for table 'tzcodes'
#
CREATE TABLE tzcodes (
tz char(3) DEFAULT '' NOT NULL,
offset int(1),
description varchar(64),
PRIMARY KEY (tz)
);
#
# Table structure for table 'users'
#
CREATE TABLE users (
uid int(11) DEFAULT '0' NOT NULL auto_increment,
nickname varchar(20) DEFAULT '' NOT NULL,
realemail varchar(50) DEFAULT '' NOT NULL,
fakeemail varchar(50),
homepage varchar(100),
passwd varchar(12) DEFAULT '' NOT NULL,
sig varchar(160),
seclev int(11) DEFAULT '0' NOT NULL,
matchname varchar(20),
PRIMARY KEY (uid),
KEY login (uid,passwd,nickname),
KEY chk4user (nickname,realemail),
KEY chk4email (realemail)
);
#
# Table structure for table 'users_comments'
#
CREATE TABLE users_comments (
uid int(11) DEFAULT '0' NOT NULL,
points int(11) DEFAULT '0' NOT NULL,
posttype varchar(10) DEFAULT 'html' NOT NULL,
defaultpoints int(11) DEFAULT '1' NOT NULL,
highlightthresh int(11) DEFAULT '4' NOT NULL,
maxcommentsize int(11) DEFAULT '4096' NOT NULL,
hardthresh tinyint(4) DEFAULT '0' NOT NULL,
clbig int(11) DEFAULT '0' NOT NULL,
clsmall int(11) DEFAULT '0' NOT NULL,
reparent tinyint(4) DEFAULT '1' NOT NULL,
nosigs tinyint(4) DEFAULT '0' NOT NULL,
commentlimit int(11) DEFAULT '100' NOT NULL,
commentspill int(11) DEFAULT '50' NOT NULL,
commentsort int(1) DEFAULT '0',
noscores tinyint(4) DEFAULT '0' NOT NULL,
mode varchar(10) DEFAULT 'thread',
threshold int(1) DEFAULT '0',
PRIMARY KEY (uid)
);
#
# Table structure for table 'users_index'
#
CREATE TABLE users_index (
uid int(11) DEFAULT '0' NOT NULL,
extid varchar(255),
exaid varchar(100),
exsect varchar(100),
exboxes varchar(255),
maxstories int(11) DEFAULT '30' NOT NULL,
noboxes tinyint(4) DEFAULT '0' NOT NULL,
PRIMARY KEY (uid)
);
#
# Table structure for table 'users_info'
#
CREATE TABLE users_info (
uid int(11) DEFAULT '0' NOT NULL,
totalmods int(11) DEFAULT '0' NOT NULL,
realname varchar(50),
bio text,
tokens int(11) DEFAULT '0' NOT NULL,
lastgranted date DEFAULT '0000-00-00' NOT NULL,
karma int(11) DEFAULT '0' NOT NULL,
maillist tinyint(4) DEFAULT '0' NOT NULL,
totalcomments int(1) DEFAULT '0',
lastmm date DEFAULT '0000-00-00' NOT NULL,
lastaccess date DEFAULT '0000-00-00' NOT NULL,
lastmmid int(11) DEFAULT '0' NOT NULL,
PRIMARY KEY (uid)
);
#
# Table structure for table 'users_key'
#
CREATE TABLE users_key (
uid int(11) DEFAULT '0' NOT NULL,
pubkey text,
PRIMARY KEY (uid)
);
#
# Table structure for table 'users_prefs'
#
CREATE TABLE users_prefs (
uid int(11) DEFAULT '0' NOT NULL,
willing tinyint(4) DEFAULT '1' NOT NULL,
dfid int(11) DEFAULT '0' NOT NULL,
tzcode char(3) DEFAULT 'edt' NOT NULL,
noicons tinyint(4) DEFAULT '0' NOT NULL,
light tinyint(4) DEFAULT '0' NOT NULL,
mylinks varchar(255) DEFAULT '' NOT NULL,
PRIMARY KEY (uid)
);
#
# Table structure for table 'vars'
#
CREATE TABLE vars (
name char(32) DEFAULT '' NOT NULL,
value char(127),
description char(127),
PRIMARY KEY (name)
);