/
slashschema_create.sql
1735 lines (1539 loc) · 51.9 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
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# MySQL dump 8.10
#
# Host: localhost Database: dump
#--------------------------------------------------------
# Server version 3.23.26-beta
#
# $Id$
#
#
# Table structure for table 'abusers'
#
DROP TABLE IF EXISTS abusers;
CREATE TABLE abusers (
abuser_id mediumint UNSIGNED NOT NULL auto_increment,
uid mediumint UNSIGNED NOT NULL,
ipid char(32) DEFAULT '' NOT NULL,
subnetid char(32) DEFAULT '' NOT NULL,
pagename varchar(20) DEFAULT '' NOT NULL,
ts datetime DEFAULT '1970-01-01 00:00:00' NOT NULL,
reason varchar(120) DEFAULT '' NOT NULL,
querystring varchar(200) DEFAULT '' NOT NULL,
PRIMARY KEY (abuser_id),
KEY uid (uid),
KEY ipid (ipid),
KEY subnetid (subnetid),
KEY reason (reason),
KEY ts (ts)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
DROP TABLE IF EXISTS accesslog;
CREATE TABLE accesslog (
id int UNSIGNED NOT NULL auto_increment,
host_addr char(39) DEFAULT '' NOT NULL,
subnetid char(39) DEFAULT '' NOT NULL,
op varchar(254) default NULL,
dat varchar(254) default NULL,
uid mediumint UNSIGNED NOT NULL,
ts datetime DEFAULT '1970-01-01 00:00:00' NOT NULL,
query_string varchar(254),
user_agent varchar(50),
skid SMALLINT UNSIGNED DEFAULT 0 NOT NULL,
bytes mediumint UNSIGNED DEFAULT 0 NOT NULL,
duration FLOAT DEFAULT 0.0 NOT NULL,
pagemark bigint UNSIGNED DEFAULT 0 NOT NULL,
local_addr VARCHAR(16) DEFAULT '' NOT NULL,
static enum("yes","no") DEFAULT "yes",
secure tinyint DEFAULT 0 NOT NULL,
referer varchar(254),
status smallint UNSIGNED DEFAULT 200 NOT NULL,
INDEX host_addr_part (host_addr(16)),
INDEX op_part (op(12), skid),
INDEX ts (ts),
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
DROP TABLE IF EXISTS accesslog_admin;
CREATE TABLE accesslog_admin (
id int UNSIGNED NOT NULL auto_increment,
host_addr char(39) DEFAULT '' NOT NULL,
op varchar(254),
dat varchar(254),
uid mediumint UNSIGNED NOT NULL,
ts datetime DEFAULT '1970-01-01 00:00:00' NOT NULL,
query_string varchar(50),
user_agent varchar(50),
skid SMALLINT UNSIGNED DEFAULT 0 NOT NULL,
bytes mediumint UNSIGNED DEFAULT 0 NOT NULL,
form MEDIUMBLOB NOT NULL,
secure tinyint DEFAULT 0 NOT NULL,
status smallint UNSIGNED DEFAULT 200 NOT NULL,
INDEX host_addr (host_addr),
INDEX ts (ts),
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
DROP TABLE IF EXISTS ajax_ops;
CREATE TABLE ajax_ops (
id mediumint(5) unsigned NOT NULL AUTO_INCREMENT,
op varchar(50) NOT NULL DEFAULT '',
class varchar(100) NOT NULL DEFAULT '',
subroutine varchar(100) NOT NULL DEFAULT '',
reskey_name varchar(64) NOT NULL DEFAULT '',
reskey_type varchar(64) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
UNIQUE KEY op (op)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
DROP TABLE IF EXISTS accesslog_artcom;
CREATE TABLE accesslog_artcom (
uid mediumint UNSIGNED NOT NULL,
ts datetime NOT NULL DEFAULT '1970-01-01 00:00:00',
c smallint unsigned NOT NULL DEFAULT '0',
INDEX uid (uid),
INDEX ts (ts)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
#
# Table structure for table 'al2'
# (The 'value' column could and should be of type BIT(32), if
# Slash required MySQL 5.0.5 or later. Since we dont, the
# code in MySQL.pm treats the INT UNSIGNED like a bit field.)
#
DROP TABLE IF EXISTS al2;
CREATE TABLE al2 (
srcid BIGINT UNSIGNED NOT NULL DEFAULT '0',
value INT UNSIGNED NOT NULL DEFAULT '0',
updatecount INT UNSIGNED NOT NULL DEFAULT '0',
PRIMARY KEY (srcid),
INDEX value (value)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
#
# Table structure for table 'al2_log'
#
DROP TABLE IF EXISTS al2_log;
CREATE TABLE al2_log (
al2lid INT UNSIGNED NOT NULL AUTO_INCREMENT,
srcid BIGINT UNSIGNED NOT NULL DEFAULT '0',
ts DATETIME NOT NULL DEFAULT '1970-01-01 00:00:00',
adminuid MEDIUMINT UNSIGNED NOT NULL DEFAULT '0',
al2tid TINYINT UNSIGNED NOT NULL DEFAULT '0',
val ENUM('set', 'clear') DEFAULT NULL,
PRIMARY KEY (al2lid),
INDEX ts (ts),
INDEX srcid_ts (srcid, ts),
INDEX al2tid_val_srcid (al2tid, val, srcid)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
#
# Table structure for table 'al2_log_comments'
#
DROP TABLE IF EXISTS al2_log_comments;
CREATE TABLE al2_log_comments (
al2lid INT UNSIGNED NOT NULL DEFAULT '0',
comment TEXT NOT NULL DEFAULT '',
PRIMARY KEY (al2lid)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
#
# Table structure for table 'al2_types'
#
DROP TABLE IF EXISTS al2_types;
CREATE TABLE al2_types (
al2tid TINYINT UNSIGNED NOT NULL AUTO_INCREMENT,
bitpos TINYINT UNSIGNED DEFAULT NULL,
name VARCHAR(30) NOT NULL DEFAULT '',
title VARCHAR(64) NOT NULL DEFAULT '',
PRIMARY KEY (al2tid),
UNIQUE name (name),
UNIQUE bitpos (bitpos)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
#
# Table structure for table 'authors_cache'
#
DROP TABLE IF EXISTS authors_cache;
CREATE TABLE authors_cache (
uid mediumint UNSIGNED NOT NULL auto_increment,
nickname varchar(20) NOT NULL,
fakeemail varchar(75) NOT NULL,
homepage varchar(100) NOT NULL,
storycount mediumint NOT NULL,
bio text NOT NULL,
author tinyint DEFAULT 0 NOT NULL,
PRIMARY KEY (uid)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
#
# Table structure for table 'backup_blocks'
#
DROP TABLE IF EXISTS backup_blocks;
CREATE TABLE backup_blocks (
bid varchar(30) DEFAULT '' NOT NULL,
block text,
PRIMARY KEY (bid)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
#
# Table structure for table 'badpasswords'
#
DROP TABLE IF EXISTS badpasswords;
CREATE TABLE badpasswords (
uid mediumint(8) UNSIGNED NOT NULL DEFAULT 0,
ip varchar(255) NOT NULL DEFAULT '',
subnet varchar(255) NOT NULL DEFAULT '',
password varchar(20) NOT NULL DEFAULT '',
ts timestamp NOT NULL,
realemail VARCHAR(50) NOT NULL DEFAULT '',
INDEX uid (uid),
INDEX ip (ip),
INDEX subnet (subnet)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
#
# Table structure for table 'blocks'
#
DROP TABLE IF EXISTS blocks;
CREATE TABLE blocks (
id mediumint(8) UNSIGNED NOT NULL auto_increment,
bid varchar(30) DEFAULT '' NOT NULL,
block text,
seclev mediumint UNSIGNED NOT NULL DEFAULT '0',
type ENUM('static','portald') DEFAULT 'static' NOT NULL,
description text,
skin varchar(30) NOT NULL,
ordernum tinyint DEFAULT '0',
title varchar(128) NOT NULL,
default_block tinyint UNSIGNED DEFAULT '0' NOT NULL,
hidden tinyint UNSIGNED DEFAULT '0' NOT NULL,
always_on tinyint UNSIGNED DEFAULT '0' NOT NULL,
portal tinyint NOT NULL DEFAULT '0',
url varchar(128),
rdf varchar(255),
retrieve tinyint NOT NULL DEFAULT '0',
last_update timestamp NOT NULL,
rss_template varchar(30),
items smallint NOT NULL DEFAULT '0',
autosubmit ENUM('no','yes') DEFAULT 'no' NOT NULL,
rss_cookie varchar(255),
all_skins tinyint NOT NULL DEFAULT '0',
shill enum('yes','no') NOT NULL default 'no',
shill_uid mediumint(8) unsigned NOT NULL default '0',
PRIMARY KEY (id),
UNIQUE KEY bid (bid),
KEY type (type),
KEY skin (skin)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
#
# Table structure for table 'classes'
#
DROP TABLE IF EXISTS classes;
CREATE TABLE classes (
id mediumint UNSIGNED NOT NULL auto_increment,
class varchar(255) NOT NULL,
db_type enum("writer","reader","log","search") DEFAULT "writer" NOT NULL,
fallback enum("writer","reader","log","search"),
UNIQUE class_key (class),
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
#
# Table structure for table 'clout_types'
#
DROP TABLE IF EXISTS clout_types;
CREATE TABLE clout_types (
clid smallint UNSIGNED NOT NULL AUTO_INCREMENT,
name varchar(16) NOT NULL,
class varchar(255) NOT NULL,
PRIMARY KEY (clid),
UNIQUE name (name)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
#
# Table structure for table 'code_param'
#
DROP TABLE IF EXISTS code_param;
CREATE TABLE code_param (
param_id smallint UNSIGNED NOT NULL auto_increment,
type varchar(24) NOT NULL,
code tinyint DEFAULT '0' NOT NULL,
name varchar(32) NOT NULL,
UNIQUE code_key (type,code),
PRIMARY KEY (param_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
#
# Table structure for table 'commentmodes'
#
DROP TABLE IF EXISTS commentmodes;
CREATE TABLE commentmodes (
mode varchar(16) DEFAULT '' NOT NULL,
name varchar(32),
description varchar(64),
PRIMARY KEY (mode)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
#
# Table structure for table 'comments'
#
DROP TABLE IF EXISTS comments;
CREATE TABLE comments (
sid mediumint UNSIGNED NOT NULL,
cid int UNSIGNED NOT NULL auto_increment,
pid int UNSIGNED DEFAULT '0' NOT NULL,
date datetime DEFAULT '1970-01-01 00:00:00' NOT NULL,
last_update TIMESTAMP NOT NULL,
ipid char(32) DEFAULT '' NOT NULL,
subnetid char(32) DEFAULT '' NOT NULL,
subject varchar(50) NOT NULL,
subject_orig ENUM('no', 'yes') DEFAULT 'yes' NOT NULL,
uid mediumint UNSIGNED NOT NULL,
points tinyint DEFAULT '0' NOT NULL,
pointsorig tinyint DEFAULT '0' NOT NULL,
pointsmax tinyint DEFAULT '0' NOT NULL,
lastmod mediumint UNSIGNED DEFAULT '0' NOT NULL,
reason tinyint UNSIGNED DEFAULT '0' NOT NULL,
signature char(32) DEFAULT '' NOT NULL,
karma_bonus enum('yes', 'no') DEFAULT 'no' NOT NULL,
len smallint UNSIGNED DEFAULT '0' NOT NULL,
karma smallint DEFAULT '0' NOT NULL,
karma_abs smallint UNSIGNED DEFAULT '0' NOT NULL,
tweak_orig TINYINT NOT NULL DEFAULT 0,
tweak TINYINT NOT NULL DEFAULT 0,
badge_id tinyint NOT NULL DEFAULT 0,
PRIMARY KEY (cid),
KEY display (sid,points,uid),
KEY byname (uid,points),
KEY ipid (ipid),
KEY subnetid (subnetid),
KEY theusual (sid,uid,points,cid),
KEY countreplies (pid,sid),
KEY uid_date (uid,date),
KEY date_sid (date,sid)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
#
# Table structure for table 'comment_log'
#
DROP TABLE IF EXISTS comment_log;
CREATE TABLE comment_log (
id int UNSIGNED NOT NULL auto_increment,
cid int UNSIGNED NOT NULL,
logtext varchar(255) DEFAULT '' NOT NULL,
ts datetime DEFAULT '1970-01-01 00:00:00' NOT NULL,
INDEX ts (ts),
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
#
# Table structure for table 'comment_promote_log'
#
DROP TABLE IF EXISTS comment_promote_log;
CREATE TABLE comment_promote_log (
id int unsigned NOT NULL auto_increment,
cid int unsigned NOT NULL default '0',
ts datetime NOT NULL default '1970-01-01 00:00:00',
PRIMARY KEY (id),
KEY cid (cid)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
#
# Table structure for table 'comment_text'
#
DROP TABLE IF EXISTS comment_text;
CREATE TABLE comment_text (
cid int UNSIGNED NOT NULL,
comment text NOT NULL,
PRIMARY KEY (cid)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
#
# Table structure for table 'content_filters'
#
DROP TABLE IF EXISTS content_filters;
CREATE TABLE content_filters (
filter_id tinyint UNSIGNED NOT NULL auto_increment,
form varchar(20) DEFAULT '' NOT NULL,
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 mediumint(6) DEFAULT '0' NOT NULL,
minimum_length mediumint DEFAULT '0' NOT NULL,
err_message varchar(150) DEFAULT '',
PRIMARY KEY (filter_id),
KEY form (form),
KEY regex (regex),
KEY field_key (field)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
#
# Table structure for table 'css_type'
#
DROP TABLE IF EXISTS css_type;
CREATE TABLE css_type (
ctid TINYINT(3) UNSIGNED NOT NULL AUTO_INCREMENT,
name VARCHAR(32) NOT NULL DEFAULT '',
ordernum TINYINT(3) UNSIGNED NOT NULL DEFAULT '0',
PRIMARY KEY (ctid)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
#
# Table structure for table 'css'
#
DROP TABLE IF EXISTS css;
CREATE TABLE css (
csid int(11) NOT NULL AUTO_INCREMENT,
rel VARCHAR(32) DEFAULT 'stylesheet',
type VARCHAR(32) DEFAULT 'text/css',
media VARCHAR(32) DEFAULT 'screen, projection',
file VARCHAR(64),
title VARCHAR(32),
skin VARCHAR(32) DEFAULT '',
page VARCHAR(32) DEFAULT '',
admin ENUM('no','yes') DEFAULT 'no',
theme VARCHAR(32) DEFAULT '',
ctid TINYINT(4) NOT NULL DEFAULT '0',
ordernum int(11) DEFAULT '0',
ie_cond VARCHAR(16) DEFAULT '',
lowbandwidth ENUM('no','yes') DEFAULT 'no',
layout VARCHAR(16) DEFAULT '',
PRIMARY KEY (csid),
KEY ctid (ctid),
KEY page_skin (page,skin),
KEY skin_page (skin,page),
KEY layout (layout)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
#
# Table structure for table 'dateformats'
#
DROP TABLE IF EXISTS dateformats;
CREATE TABLE dateformats (
id tinyint UNSIGNED DEFAULT '0' NOT NULL,
format varchar(64),
description varchar(64),
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
#
# Table structure for table 'dbs'
#
DROP TABLE IF EXISTS dbs;
CREATE TABLE dbs (
id mediumint UNSIGNED NOT NULL auto_increment,
virtual_user varchar(100) NOT NULL,
isalive enum("no","yes") DEFAULT "no" NOT NULL,
type enum("writer","reader","log","search", "log_slave","querylog") DEFAULT "reader" NOT NULL,
weight tinyint UNSIGNED NOT NULL DEFAULT 1,
weight_adjust float UNSIGNED NOT NULL DEFAULT 1.0,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
#
# Table structure for table 'dbs_readerstatus'
#
DROP TABLE IF EXISTS dbs_readerstatus;
CREATE TABLE dbs_readerstatus (
ts datetime DEFAULT '1970-01-01 00:00:00' NOT NULL,
dbid mediumint UNSIGNED NOT NULL,
was_alive enum("no","yes") DEFAULT "yes" NOT NULL,
was_reachable enum("no","yes") DEFAULT "yes",
was_running enum("no","yes") DEFAULT "yes",
slave_lag_secs float DEFAULT '0',
query_bog_secs float DEFAULT '0',
bog_rsqid mediumint UNSIGNED DEFAULT NULL,
had_weight tinyint UNSIGNED DEFAULT 1,
had_weight_adjust float UNSIGNED DEFAULT 1,
KEY ts_dbid (ts, dbid)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
#
# Table structure for table 'dbs_readerstatus_queries'
#
DROP TABLE IF EXISTS dbs_readerstatus_queries;
CREATE TABLE dbs_readerstatus_queries (
rsqid mediumint UNSIGNED NOT NULL auto_increment,
text varchar(255),
PRIMARY KEY (rsqid),
KEY text (text)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
#
# Table structure for table 'discussions'
#
DROP TABLE IF EXISTS discussions;
CREATE TABLE discussions (
id mediumint UNSIGNED NOT NULL auto_increment,
dkid TINYINT UNSIGNED NOT NULL DEFAULT 1,
stoid mediumint UNSIGNED DEFAULT '0' NOT NULL,
sid char(16) DEFAULT '' NOT NULL,
title varchar(128) NOT NULL,
url varchar(255) NOT NULL,
topic int UNSIGNED NOT NULL,
ts datetime DEFAULT '1970-01-01 00:00:00' NOT NULL,
type ENUM("open","recycle","archived") DEFAULT 'open' NOT NULL,
uid mediumint UNSIGNED NOT NULL,
commentcount smallint UNSIGNED DEFAULT '0' NOT NULL,
flags ENUM("ok","delete","dirty") DEFAULT 'ok' NOT NULL,
primaryskid SMALLINT UNSIGNED,
last_update timestamp NOT NULL,
approved tinyint UNSIGNED DEFAULT 0 NOT NULL,
commentstatus ENUM('disabled','enabled','friends_only','friends_fof_only','no_foe','no_foe_eof','logged_in') DEFAULT 'enabled' NOT NULL, /* Default is that we allow anyone to write */
archivable ENUM("no","yes") DEFAULT "yes" NOT NULL,
KEY (stoid),
KEY (sid),
KEY (topic),
KEY (primaryskid,ts),
INDEX (type,uid,ts),
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
#
# Table structure for table 'discussion_kinds'
#
DROP TABLE IF EXISTS discussion_kinds;
CREATE TABLE discussion_kinds (
dkid TINYINT UNSIGNED NOT NULL AUTO_INCREMENT,
name VARCHAR(30) NOT NULL DEFAULT '',
PRIMARY KEY (dkid),
UNIQUE name (name)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
#
# Table structure for table 'dst'
#
DROP TABLE IF EXISTS dst;
CREATE TABLE dst (
region VARCHAR(32) NOT NULL,
selectable TINYINT DEFAULT 0 NOT NULL,
start_hour TINYINT NOT NULL,
start_wnum TINYINT NOT NULL,
start_wday TINYINT NOT NULL,
start_month TINYINT NOT NULL,
end_hour TINYINT NOT NULL,
end_wnum TINYINT NOT NULL,
end_wday TINYINT NOT NULL,
end_month TINYINT NOT NULL,
PRIMARY KEY (region)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
#
# Table structure for table 'file_queue'
#
DROP TABLE IF EXISTS file_queue;
CREATE TABLE file_queue (
fqid int(10) unsigned NOT NULL auto_increment,
stoid mediumint(8) unsigned default NULL,
fhid mediumint(8) unsigned default NULL,
file varchar(255) default NULL,
action enum('upload','thumbnails','sprite') default NULL,
blobid VARCHAR(32) DEFAULT "" NOT NULL,
PRIMARY KEY (fqid)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
#
# Table structure for table 'formkeys'
#
DROP TABLE IF EXISTS formkeys;
CREATE TABLE formkeys (
formkey varchar(20) DEFAULT '' NOT NULL,
formname varchar(32) DEFAULT '' NOT NULL,
id varchar(30) DEFAULT '' NOT NULL,
idcount mediumint UNSIGNED DEFAULT 0 NOT NULL,
uid mediumint UNSIGNED NOT NULL,
ipid char(32) DEFAULT '' NOT NULL,
subnetid char(32) DEFAULT '' NOT NULL,
value tinyint DEFAULT '0' NOT NULL,
last_ts int UNSIGNED DEFAULT '0' NOT NULL,
ts int UNSIGNED DEFAULT '0' NOT NULL,
submit_ts int UNSIGNED DEFAULT '0' NOT NULL,
content_length smallint UNSIGNED DEFAULT '0' NOT NULL,
PRIMARY KEY (formkey),
KEY formname (formname),
KEY uid (uid),
KEY ipid (ipid),
KEY subnetid (subnetid),
KEY idcount (idcount),
KEY ts (ts),
KEY last_ts (ts),
KEY submit_ts (submit_ts)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
#
# Table structure for table 'globjs' (global objects)
#
DROP TABLE IF EXISTS globjs;
CREATE TABLE globjs (
globjid int UNSIGNED NOT NULL auto_increment,
gtid smallint UNSIGNED NOT NULL,
target_id int UNSIGNED NOT NULL,
PRIMARY KEY (globjid),
UNIQUE target (gtid, target_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
#
# Table structure for table 'globj_adminnotes'
#
DROP TABLE IF EXISTS globj_adminnotes;
CREATE TABLE globj_adminnotes (
globjid int UNSIGNED NOT NULL AUTO_INCREMENT,
adminnote varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (globjid)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
#
# Table structure for table 'globj_types'
#
DROP TABLE IF EXISTS globj_types;
CREATE TABLE globj_types (
gtid smallint UNSIGNED NOT NULL auto_increment,
maintable VARCHAR(64) NOT NULL,
PRIMARY KEY (gtid),
UNIQUE maintable (maintable)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
#
# Table structure for table 'globj_urls'
#
DROP TABLE IF EXISTS globj_urls;
CREATE TABLE globj_urls (
id INT(10) UNSIGNED NOT NULL auto_increment,
globjid INT UNSIGNED NOT NULL DEFAULT 0,
url_id INT(10) UNSIGNED NOT NULL NOT NULL DEFAULT 0,
PRIMARY KEY (id),
UNIQUE globjid_url_id (globjid, url_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
#
# Table structure for table 'hooks'
#
DROP TABLE IF EXISTS hooks;
CREATE TABLE hooks (
id mediumint(5) UNSIGNED NOT NULL auto_increment,
param varchar(50) DEFAULT '' NOT NULL,
class varchar(100) DEFAULT '' NOT NULL,
subroutine varchar(100) DEFAULT '' NOT NULL,
PRIMARY KEY (id),
UNIQUE hook_param (param,class,subroutine)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
#
# Table structure for table 'menus'
#
DROP TABLE IF EXISTS menus;
CREATE TABLE menus (
id mediumint(5) UNSIGNED NOT NULL auto_increment,
menu varchar(20) DEFAULT '' NOT NULL,
label varchar(255) DEFAULT '' NOT NULL,
sel_label varchar(32) NOT NULL DEFAULT '',
value text,
seclev mediumint UNSIGNED NOT NULL,
showanon tinyint DEFAULT '0' NOT NULL,
menuorder mediumint(5),
PRIMARY KEY (id),
KEY page_labels (menu,label),
UNIQUE page_labels_un (menu,label)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
#
# Table structure for table 'misc_user_opts'
#
DROP TABLE IF EXISTS misc_user_opts;
CREATE TABLE misc_user_opts (
name varchar(32) NOT NULL,
optorder mediumint(5),
seclev mediumint UNSIGNED NOT NULL,
default_val text NOT NULL,
vals_regex text,
short_desc text,
long_desc text,
opts_html text,
PRIMARY KEY (name)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
#
# Table structure for table 'open_proxies'
#
DROP TABLE IF EXISTS open_proxies;
CREATE TABLE open_proxies (
ip VARCHAR(15) NOT NULL,
port SMALLINT UNSIGNED NOT NULL DEFAULT '0',
dur FLOAT DEFAULT NULL,
ts DATETIME NOT NULL DEFAULT '1970-01-01 00:00:00',
xff VARCHAR(40) DEFAULT NULL,
ipid CHAR(32) DEFAULT '' NOT NULL,
PRIMARY KEY (ip),
KEY ts (ts),
KEY ipid (ipid)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
#
# Table structure for table 'pagemark'
#
DROP TABLE IF EXISTS pagemark;
CREATE TABLE pagemark (
id int UNSIGNED NOT NULL AUTO_INCREMENT,
pagemark bigint UNSIGNED DEFAULT 0 NOT NULL,
ts datetime NOT NULL DEFAULT '1970-01-01 00:00:00',
dom float DEFAULT 0 NOT NULL,
js float DEFAULT 0 NOT NULL,
PRIMARY KEY id (id),
UNIQUE pagemark (pagemark),
KEY ts (ts)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
#
# Table structure for table 'pollanswers'
#
DROP TABLE IF EXISTS pollanswers;
CREATE TABLE pollanswers (
qid mediumint UNSIGNED NOT NULL,
aid mediumint NOT NULL,
answer char(255),
votes mediumint,
PRIMARY KEY (qid,aid)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
#
# Table structure for table 'pollquestions'
#
DROP TABLE IF EXISTS pollquestions;
CREATE TABLE pollquestions (
qid mediumint UNSIGNED NOT NULL auto_increment,
question char(255) NOT NULL,
voters mediumint,
topic smallint UNSIGNED NOT NULL,
discussion mediumint UNSIGNED NULL,
date datetime,
uid mediumint UNSIGNED NOT NULL,
primaryskid SMALLINT UNSIGNED,
autopoll ENUM("no","yes") DEFAULT 'no' NOT NULL,
flags ENUM("ok","delete","dirty") DEFAULT 'ok' NOT NULL,
polltype enum('nodisplay','section','story') default 'section',
PRIMARY KEY (qid),
KEY uid (uid),
KEY discussion (discussion)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
#
# Table structure for table 'pollvoters'
#
DROP TABLE IF EXISTS pollvoters;
CREATE TABLE pollvoters (
qid mediumint NOT NULL,
id char(35) NOT NULL,
time datetime,
uid mediumint UNSIGNED NOT NULL,
KEY qid (qid,id,uid)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
#
# Table structure for table 'preview'
#
DROP TABLE IF EXISTS preview;
CREATE TABLE preview (
preview_id mediumint UNSIGNED NOT NULL auto_increment,
uid mediumint UNSIGNED NOT NULL,
src_fhid mediumint UNSIGNED NOT NULL DEFAULT 0,
preview_fhid mediumint UNSIGNED NOT NULL DEFAULT 0,
title VARCHAR(255) NOT NULL DEFAULT '',
introtext text NOT NULL,
bodytext text NOT NULL,
active ENUM("no","yes") DEFAULT "yes",
PRIMARY KEY (preview_id),
KEY uid (uid)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
#
# Table structure for table 'preview_param'
#
DROP TABLE IF EXISTS preview_param;
CREATE TABLE preview_param (
param_id mediumint UNSIGNED NOT NULL auto_increment,
preview_id mediumint UNSIGNED NOT NULL,
name varchar(32) DEFAULT '' NOT NULL,
value text NOT NULL,
UNIQUE submission_key (preview_id,name),
PRIMARY KEY (param_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
DROP TABLE IF EXISTS projects;
CREATE TABLE projects (
id mediumint UNSIGNED NOT NULL auto_increment,
uid mediumint UNSIGNED NOT NULL DEFAULT 0,
unixname varchar(24) NOT NULL DEFAULT '',
textname varchar(64) NOT NULL DEFAULT '',
url_id INT(10) UNSIGNED NOT NULL DEFAULT 0,
createtime DATETIME DEFAULT '1970-01-01 00:00:00' NOT NULL,
srcname varchar(32) NOT NULL DEFAULT 0,
description TEXT NOT NULL DEFAULT '',
PRIMARY KEY (id),
UNIQUE unixname (unixname)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
#
# Table structure for table 'querylog'
#
DROP TABLE IF EXISTS querylog;
CREATE TABLE querylog (
id int UNSIGNED NOT NULL auto_increment,
type enum('SELECT','INSERT','UPDATE','DELETE','REPLACE') NOT NULL DEFAULT 'SELECT',
thetables varchar(40) NOT NULL DEFAULT '',
ts timestamp NOT NULL,
package varchar(24) NOT NULL DEFAULT '',
line mediumint UNSIGNED NOT NULL DEFAULT '0',
package1 varchar(24) NOT NULL DEFAULT '',
line1 mediumint UNSIGNED NOT NULL DEFAULT '0',
duration float NOT NULL DEFAULT '0',
PRIMARY KEY (id),
KEY caller (package, line),
KEY ts (ts),
KEY type (type)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
DROP TABLE IF EXISTS related_stories;
CREATE TABLE related_stories (
id mediumint(8) unsigned NOT NULL auto_increment,
stoid mediumint(8) unsigned default '0',
rel_stoid mediumint(8) unsigned default '0',
rel_sid varchar(16) NOT NULL default '',
title varchar(255) default '',
url varchar(255) default '',
cid int(8) unsigned NOT NULL default '0',
ordernum smallint unsigned NOT NULL default '0',
fhid mediumint(8) unsigned NOT NULL default '0',
PRIMARY KEY (id),
KEY stoid (stoid)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
#
# Table structure for table 'rss_raw'
#
DROP TABLE IF EXISTS rss_raw;
CREATE TABLE rss_raw (
id mediumint UNSIGNED NOT NULL auto_increment,
link_signature char(32) DEFAULT '' NOT NULL,
title_signature char(32) DEFAULT '' NOT NULL,
description_signature char(32) DEFAULT '' NOT NULL,
link varchar(255) NOT NULL,
title varchar(255) NOT NULL,
description text,
subid mediumint UNSIGNED,
bid varchar(30),
created datetime,
processed ENUM("no","yes") DEFAULT 'no' NOT NULL,
UNIQUE uber_signature (link_signature, title_signature, description_signature),
PRIMARY KEY (id),
KEY processed (processed)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
#
# Table structure for table 'related_links'
#
DROP TABLE IF EXISTS related_links;
CREATE TABLE related_links (
id smallint UNSIGNED NOT NULL auto_increment,
keyword varchar(30) NOT NULL,
name varchar(30) NOT NULL,
link varchar(128) NOT NULL,
KEY (keyword),
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
#
# Table structure for table 'remarks'
#
DROP TABLE IF EXISTS remarks;
CREATE TABLE remarks (
rid MEDIUMINT UNSIGNED NOT NULL auto_increment,
uid MEDIUMINT UNSIGNED NOT NULL,
stoid MEDIUMINT UNSIGNED NOT NULL,
priority SMALLINT UNSIGNED NOT NULL DEFAULT 0,
time DATETIME DEFAULT '1970-01-01 00:00:00' NOT NULL,
type ENUM("system","user") DEFAULT "user",
remark VARCHAR(100),
PRIMARY KEY (rid),
INDEX uid (uid),
INDEX stoid (stoid),
INDEX time (time),
INDEX priority (priority)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
#
# Table structure for table 'sessions'
#
DROP TABLE IF EXISTS sessions;
CREATE TABLE sessions (
session mediumint UNSIGNED NOT NULL auto_increment,
uid mediumint UNSIGNED,
lasttime datetime,
lasttitle varchar(50),
last_subid mediumint UNSIGNED,
last_sid varchar(16),
last_fhid mediumint UNSIGNED,
last_action varchar(16),
UNIQUE (uid),
PRIMARY KEY (session)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
DROP TABLE IF EXISTS shill_ids;
CREATE TABLE shill_ids (
shill_id TINYINT UNSIGNED DEFAULT 0 NOT NULL PRIMARY KEY,
user varchar(16) NOT NULL default ''
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
DROP TABLE IF EXISTS signoff;
CREATE TABLE signoff (
soid MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT,
stoid MEDIUMINT UNSIGNED NOT NULL DEFAULT '0',
uid MEDIUMINT UNSIGNED NOT NULL,
signoff_time TIMESTAMP,
signoff_type VARCHAR(16) DEFAULT '' NOT NULL,
PRIMARY KEY(soid),
INDEX (stoid)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
#
# Table structure for table 'site_info'
#
DROP TABLE IF EXISTS site_info;
CREATE TABLE site_info (
param_id mediumint UNSIGNED NOT NULL auto_increment,
name varchar(50) NOT NULL,
value varchar(200) NOT NULL,
description varchar(255),
UNIQUE site_keys (name,value),
PRIMARY KEY (param_id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
#
# Table structure for table 'skins'
#
DROP TABLE IF EXISTS skins;
CREATE TABLE skins (
skid SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT,
nexus INT UNSIGNED NOT NULL,
artcount_min MEDIUMINT UNSIGNED DEFAULT '10' NOT NULL,
artcount_max MEDIUMINT UNSIGNED DEFAULT '30' NOT NULL,
older_stories_max MEDIUMINT UNSIGNED DEFAULT '0' NOT NULL,
name VARCHAR(30) NOT NULL,
othername VARCHAR(30) NOT NULL DEFAULT '',
title VARCHAR(64) DEFAULT '' NOT NULL,
issue ENUM('no', 'yes') DEFAULT 'no' NOT NULL,
submittable ENUM('no', 'yes') DEFAULT 'yes' NOT NULL,
searchable ENUM('no', 'yes') DEFAULT 'yes' NOT NULL,
storypickable ENUM('no', 'yes') DEFAULT 'yes' NOT NULL,
skinindex ENUM('no', 'yes') DEFAULT 'yes' NOT NULL,
url VARCHAR(255) DEFAULT '' NOT NULL,
hostname VARCHAR(128) DEFAULT '' NOT NULL,
cookiedomain VARCHAR(128) DEFAULT '' NOT NULL,
index_handler VARCHAR(30) DEFAULT 'index.pl' NOT NULL,
max_rewrite_secs MEDIUMINT UNSIGNED DEFAULT '3600' NOT NULL,
last_rewrite timestamp NOT NULL,
ac_uid mediumint UNSIGNED DEFAULT '0' NOT NULL,
require_acl VARCHAR(32) DEFAULT '' NOT NULL,
PRIMARY KEY (skid),
UNIQUE name (name)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
#
# Table structure for table 'skin_colors'
#
DROP TABLE IF EXISTS skin_colors;
CREATE TABLE skin_colors (