~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/include/slashdot.sql

  • Committer: Brian Aker
  • Date: 2010-12-08 22:35:56 UTC
  • mfrom: (1819.9.158 update-innobase)
  • Revision ID: brian@tangent.org-20101208223556-37mi4omqg7lkjzf3
Merge in Stewart's changes, 1.3 changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--
 
2
-- Table structure for table `abusers`
 
3
--
 
4
 
 
5
DROP TABLE IF EXISTS `abusers`;
 
6
CREATE TABLE `abusers` (
 
7
  `abuser_id` bigint NOT NULL auto_increment,
 
8
  `uid` bigint NOT NULL default '0',
 
9
  `ipid` varchar(32) NOT NULL default '',
 
10
  `subnetid` varchar(32) NOT NULL default '',
 
11
  `pagename` varchar(20) NOT NULL default '',
 
12
  `ts` datetime NOT NULL,
 
13
  `reason` varchar(120) NOT NULL default '',
 
14
  `querystring` varchar(200) NOT NULL default '',
 
15
  PRIMARY KEY  (`abuser_id`),
 
16
  KEY `uid` (`uid`),
 
17
  KEY `ipid` (`ipid`),
 
18
  KEY `subnetid` (`subnetid`),
 
19
  KEY `reason` (`reason`),
 
20
  KEY `ts` (`ts`)
 
21
);
 
22
 
 
23
--
 
24
-- Table structure for table `accesslog_build_unique_uid`
 
25
--
 
26
 
 
27
DROP TABLE IF EXISTS `accesslog_build_unique_uid`;
 
28
CREATE TABLE `accesslog_build_unique_uid` (
 
29
  `uid` bigint NOT NULL default '0',
 
30
  PRIMARY KEY  (`uid`)
 
31
);
 
32
 
 
33
--
 
34
-- Table structure for table `accesslog_temp_host_addr`
 
35
--
 
36
 
 
37
DROP TABLE IF EXISTS `accesslog_temp_host_addr`;
 
38
CREATE TABLE `accesslog_temp_host_addr` (
 
39
  `host_addr` varchar(32) NOT NULL default '',
 
40
  `anon` enum('no','yes') NOT NULL default 'yes',
 
41
  PRIMARY KEY  (`host_addr`,`anon`),
 
42
  UNIQUE KEY `host_addr` (`host_addr`)
 
43
);
 
44
 
 
45
--
 
46
-- Table structure for table `achievements`
 
47
--
 
48
 
 
49
DROP TABLE IF EXISTS `achievements`;
 
50
CREATE TABLE `achievements` (
 
51
  `aid` bigint NOT NULL auto_increment,
 
52
  `name` varchar(30) NOT NULL default '',
 
53
  `description` varchar(128) NOT NULL default '',
 
54
  `repeatable` enum('yes','no') NOT NULL default 'no',
 
55
  `increment` int NOT NULL default '0',
 
56
  PRIMARY KEY  (`aid`),
 
57
  UNIQUE KEY `achievement` (`name`)
 
58
);
 
59
 
 
60
--
 
61
-- Table structure for table `ajax_ops`
 
62
--
 
63
 
 
64
DROP TABLE IF EXISTS `ajax_ops`;
 
65
CREATE TABLE `ajax_ops` (
 
66
  `id` bigint NOT NULL auto_increment,
 
67
  `op` varchar(50) NOT NULL default '',
 
68
  `class` varchar(100) NOT NULL default '',
 
69
  `subroutine` varchar(100) NOT NULL default '',
 
70
  `reskey_name` varchar(64) NOT NULL default '',
 
71
  `reskey_type` varchar(64) NOT NULL default '',
 
72
  PRIMARY KEY  (`id`),
 
73
  UNIQUE KEY `op` (`op`)
 
74
);
 
75
 
 
76
--
 
77
-- Table structure for table `al2`
 
78
--
 
79
 
 
80
DROP TABLE IF EXISTS `al2`;
 
81
CREATE TABLE `al2` (
 
82
  `srcid` bigint NOT NULL default '0',
 
83
  `value` int NOT NULL default '0',
 
84
  `updatecount` int NOT NULL default '0',
 
85
  PRIMARY KEY  (`srcid`),
 
86
  KEY `value` (`value`)
 
87
);
 
88
 
 
89
--
 
90
-- Table structure for table `al2_log`
 
91
--
 
92
 
 
93
DROP TABLE IF EXISTS `al2_log`;
 
94
CREATE TABLE `al2_log` (
 
95
  `al2lid` int NOT NULL auto_increment,
 
96
  `srcid` bigint NOT NULL default '0',
 
97
  `ts` datetime NOT NULL,
 
98
  `adminuid` bigint NOT NULL default '0',
 
99
  `al2tid` int NOT NULL default '0',
 
100
  `val` enum('set','clear') default NULL,
 
101
  PRIMARY KEY  (`al2lid`),
 
102
  KEY `ts` (`ts`),
 
103
  KEY `srcid_ts` (`srcid`,`ts`),
 
104
  KEY `al2tid_val_srcid` (`al2tid`,`val`,`srcid`)
 
105
);
 
106
 
 
107
--
 
108
-- Table structure for table `al2_log_comments`
 
109
--
 
110
 
 
111
DROP TABLE IF EXISTS `al2_log_comments`;
 
112
CREATE TABLE `al2_log_comments` (
 
113
  `al2lid` int NOT NULL default '0',
 
114
  `comment` text NOT NULL,
 
115
  PRIMARY KEY  (`al2lid`)
 
116
);
 
117
 
 
118
--
 
119
-- Table structure for table `al2_types`
 
120
--
 
121
 
 
122
DROP TABLE IF EXISTS `al2_types`;
 
123
CREATE TABLE `al2_types` (
 
124
  `al2tid` int NOT NULL auto_increment,
 
125
  `bitpos` int default NULL,
 
126
  `name` varchar(30) NOT NULL default '',
 
127
  `title` varchar(64) NOT NULL default '',
 
128
  PRIMARY KEY  (`al2tid`),
 
129
  UNIQUE KEY `name` (`name`),
 
130
  UNIQUE KEY `bitpos` (`bitpos`)
 
131
);
 
132
 
 
133
--
 
134
-- Table structure for table `anniversary`
 
135
--
 
136
 
 
137
DROP TABLE IF EXISTS `anniversary`;
 
138
CREATE TABLE `anniversary` (
 
139
  `id` bigint NOT NULL auto_increment,
 
140
  `uid` bigint NOT NULL default '0',
 
141
  `discussion_id` bigint NOT NULL default '0',
 
142
  `state` varchar(2) NOT NULL default '',
 
143
  `country` varchar(2) NOT NULL default '',
 
144
  `ts` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
 
145
  `venue` varchar(255) NOT NULL default '',
 
146
  `datetime` varchar(255) NOT NULL default '',
 
147
  `address` varchar(255) NOT NULL default '',
 
148
  `city` varchar(255) NOT NULL default '',
 
149
  `email` varchar(255) NOT NULL default '',
 
150
  PRIMARY KEY  (`id`),
 
151
  KEY `uid` (`uid`)
 
152
);
 
153
 
 
154
--
 
155
-- Table structure for table `authors_cache`
 
156
--
 
157
 
 
158
DROP TABLE IF EXISTS `authors_cache`;
 
159
CREATE TABLE `authors_cache` (
 
160
  `uid` bigint NOT NULL auto_increment,
 
161
  `nickname` varchar(20) NOT NULL default '',
 
162
  `fakeemail` varchar(75) NOT NULL default '',
 
163
  `homepage` varchar(100) NOT NULL default '',
 
164
  `storycount` bigint NOT NULL default '0',
 
165
  `bio` text NOT NULL,
 
166
  `author` int NOT NULL default '0',
 
167
  PRIMARY KEY  (`uid`)
 
168
);
 
169
 
 
170
--
 
171
-- Table structure for table `auto_poll`
 
172
--
 
173
 
 
174
DROP TABLE IF EXISTS `auto_poll`;
 
175
CREATE TABLE `auto_poll` (
 
176
  `id` bigint NOT NULL auto_increment,
 
177
  `primaryskid` int default NULL,
 
178
  `qid` bigint default NULL,
 
179
  PRIMARY KEY  (`id`)
 
180
);
 
181
 
 
182
--
 
183
-- Table structure for table `backup_blocks`
 
184
--
 
185
 
 
186
DROP TABLE IF EXISTS `backup_blocks`;
 
187
CREATE TABLE `backup_blocks` (
 
188
  `bid` varchar(30) NOT NULL default '',
 
189
  `block` text,
 
190
  PRIMARY KEY  (`bid`)
 
191
);
 
192
 
 
193
--
 
194
-- Table structure for table `badge_ids`
 
195
--
 
196
 
 
197
DROP TABLE IF EXISTS `badge_ids`;
 
198
CREATE TABLE `badge_ids` (
 
199
  `badge_id` int NOT NULL auto_increment,
 
200
  `badge_text` varchar(32) NOT NULL default '',
 
201
  `badge_url` varchar(255) NOT NULL default '',
 
202
  `badge_icon` varchar(32) NOT NULL default '',
 
203
  PRIMARY KEY  (`badge_id`)
 
204
);
 
205
 
 
206
--
 
207
-- Table structure for table `badpasswords`
 
208
--
 
209
 
 
210
DROP TABLE IF EXISTS `badpasswords`;
 
211
CREATE TABLE `badpasswords` (
 
212
  `uid` bigint NOT NULL default '0',
 
213
  `ip` varchar(15) NOT NULL default '',
 
214
  `subnet` varchar(15) NOT NULL default '',
 
215
  `password` varchar(20) NOT NULL default '',
 
216
  `ts` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
 
217
  `realemail` varchar(50) NOT NULL default '',
 
218
  KEY `uid` (`uid`),
 
219
  KEY `ip` (`ip`),
 
220
  KEY `subnet` (`subnet`)
 
221
);
 
222
 
 
223
--
 
224
-- Table structure for table `blobs`
 
225
--
 
226
 
 
227
DROP TABLE IF EXISTS `blobs`;
 
228
CREATE TABLE `blobs` (
 
229
  `id` varchar(32) NOT NULL default '',
 
230
  `content_type` varchar(80) NOT NULL default '',
 
231
  `filename` varchar(80) NOT NULL default '',
 
232
  `seclev` bigint NOT NULL default '0',
 
233
  `reference_count` bigint NOT NULL default '1',
 
234
  `data` longblob NOT NULL,
 
235
  PRIMARY KEY  (`id`)
 
236
);
 
237
 
 
238
--
 
239
-- Table structure for table `blocks`
 
240
--
 
241
 
 
242
DROP TABLE IF EXISTS `blocks`;
 
243
CREATE TABLE `blocks` (
 
244
  `bid` varchar(30) NOT NULL default '',
 
245
  `block` text,
 
246
  `seclev` bigint NOT NULL default '0',
 
247
  `type` enum('static','portald') NOT NULL default 'static',
 
248
  `description` text,
 
249
  `skin` varchar(30) NOT NULL default '',
 
250
  `ordernum` int default '0',
 
251
  `title` varchar(128) NOT NULL default '',
 
252
  `portal` int NOT NULL default '0',
 
253
  `url` varchar(128) default NULL,
 
254
  `rdf` varchar(255) default NULL,
 
255
  `retrieve` int NOT NULL default '0',
 
256
  `last_update` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
 
257
  `rss_template` varchar(30) default NULL,
 
258
  `items` int NOT NULL default '0',
 
259
  `autosubmit` enum('no','yes') NOT NULL default 'no',
 
260
  `rss_cookie` varchar(255) default NULL,
 
261
  `all_skins` int NOT NULL default '0',
 
262
  `shill` enum('yes','no') NOT NULL default 'no',
 
263
  `shill_uid` bigint NOT NULL default '0',
 
264
  `id` bigint NOT NULL auto_increment,
 
265
  PRIMARY KEY  (`id`),
 
266
  UNIQUE KEY `bid` (`bid`),
 
267
  KEY `type` (`type`),
 
268
  KEY `skin` (`skin`)
 
269
);
 
270
 
 
271
--
 
272
-- Table structure for table `bookmark_feeds`
 
273
--
 
274
 
 
275
DROP TABLE IF EXISTS `bookmark_feeds`;
 
276
CREATE TABLE `bookmark_feeds` (
 
277
  `id` bigint NOT NULL auto_increment,
 
278
  `uid` bigint NOT NULL,
 
279
  `feed` varchar(255) default NULL,
 
280
  `feedname` varchar(32) default NULL,
 
281
  `tags` varchar(255) default NULL,
 
282
  `nofilter` int NOT NULL default '0',
 
283
  `attended` enum('no','yes') NOT NULL default 'no',
 
284
  `firehose` enum('no','yes') default 'yes',
 
285
  `microbin` enum('no','yes') default 'no',
 
286
  PRIMARY KEY  (`id`),
 
287
  KEY `uid` (`uid`)
 
288
);
 
289
 
 
290
--
 
291
-- Table structure for table `bookmarks`
 
292
--
 
293
 
 
294
DROP TABLE IF EXISTS `bookmarks`;
 
295
CREATE TABLE `bookmarks` (
 
296
  `bookmark_id` bigint NOT NULL auto_increment,
 
297
  `uid` bigint NOT NULL default '0',
 
298
  `url_id` int NOT NULL,
 
299
  `createdtime` datetime NOT NULL,
 
300
  `title` varchar(255) default NULL,
 
301
  `srcid_32` bigint NOT NULL default '0',
 
302
  `srcid_24` bigint NOT NULL default '0',
 
303
  `srcname` varchar(32) NOT NULL default '',
 
304
  PRIMARY KEY  (`bookmark_id`),
 
305
  UNIQUE KEY `url_id_uid` (`url_id`,`uid`),
 
306
  KEY `srcid_32` (`srcid_32`),
 
307
  KEY `srcid_24` (`srcid_24`)
 
308
);
 
309
 
 
310
--
 
311
-- Table structure for table `bpn_sources`
 
312
--
 
313
 
 
314
DROP TABLE IF EXISTS `bpn_sources`;
 
315
CREATE TABLE `bpn_sources` (
 
316
  `name` varchar(30) NOT NULL default '',
 
317
  `active` enum('no','yes') NOT NULL default 'yes',
 
318
  `source` varchar(255) NOT NULL default '',
 
319
  `regex` varchar(255) NOT NULL default '',
 
320
  `al2name` varchar(30) NOT NULL default 'nopostanon',
 
321
  PRIMARY KEY  (`name`)
 
322
);
 
323
 
 
324
--
 
325
-- Table structure for table `classes`
 
326
--
 
327
 
 
328
DROP TABLE IF EXISTS `classes`;
 
329
CREATE TABLE `classes` (
 
330
  `id` bigint NOT NULL auto_increment,
 
331
  `class` varchar(255) NOT NULL default '',
 
332
  `db_type` enum('writer','reader','log','search','log_slave') NOT NULL default 'writer',
 
333
  `fallback` enum('writer','reader','log','search','log_slave') default NULL,
 
334
  PRIMARY KEY  (`id`),
 
335
  UNIQUE KEY `class_key` (`class`)
 
336
);
 
337
 
 
338
--
 
339
-- Table structure for table `clout_types`
 
340
--
 
341
 
 
342
DROP TABLE IF EXISTS `clout_types`;
 
343
CREATE TABLE `clout_types` (
 
344
  `clid` int NOT NULL auto_increment,
 
345
  `name` varchar(16) NOT NULL,
 
346
  `class` varchar(255) NOT NULL,
 
347
  PRIMARY KEY  (`clid`),
 
348
  UNIQUE KEY `name` (`name`)
 
349
);
 
350
 
 
351
--
 
352
-- Table structure for table `code_param`
 
353
--
 
354
 
 
355
DROP TABLE IF EXISTS `code_param`;
 
356
CREATE TABLE `code_param` (
 
357
  `param_id` int NOT NULL auto_increment,
 
358
  `type` varchar(24) NOT NULL default '',
 
359
  `code` int NOT NULL default '0',
 
360
  `name` varchar(32) NOT NULL default '',
 
361
  PRIMARY KEY  (`param_id`),
 
362
  UNIQUE KEY `code_key` (`type`,`code`)
 
363
);
 
364
 
 
365
--
 
366
-- Table structure for table `comment_log`
 
367
--
 
368
 
 
369
DROP TABLE IF EXISTS `comment_log`;
 
370
CREATE TABLE `comment_log` (
 
371
  `id` int NOT NULL auto_increment,
 
372
  `cid` int NOT NULL,
 
373
  `logtext` varchar(255) NOT NULL default '',
 
374
  `ts` datetime NOT NULL default '1970-01-01 00:00:00',
 
375
  PRIMARY KEY  (`id`),
 
376
  KEY `ts` (`ts`),
 
377
  KEY `cid` (`cid`)
 
378
);
 
379
 
 
380
--
 
381
-- Table structure for table `comment_promote_log`
 
382
--
 
383
 
 
384
DROP TABLE IF EXISTS `comment_promote_log`;
 
385
CREATE TABLE `comment_promote_log` (
 
386
  `id` int NOT NULL auto_increment,
 
387
  `cid` int NOT NULL default '0',
 
388
  `ts` datetime NOT NULL default '1970-01-01 00:00:00',
 
389
  PRIMARY KEY  (`id`),
 
390
  KEY `cid` (`cid`)
 
391
);
 
392
 
 
393
--
 
394
-- Table structure for table `comment_text`
 
395
--
 
396
 
 
397
DROP TABLE IF EXISTS `comment_text`;
 
398
CREATE TABLE `comment_text` (
 
399
  `cid` int NOT NULL default '0',
 
400
  `comment` text NOT NULL,
 
401
  PRIMARY KEY  (`cid`)
 
402
);
 
403
 
 
404
--
 
405
-- Table structure for table `commentmodes`
 
406
--
 
407
 
 
408
DROP TABLE IF EXISTS `commentmodes`;
 
409
CREATE TABLE `commentmodes` (
 
410
  `mode` varchar(16) NOT NULL default '',
 
411
  `name` varchar(32) default NULL,
 
412
  `description` varchar(64) default NULL,
 
413
  PRIMARY KEY  (`mode`)
 
414
);
 
415
 
 
416
--
 
417
-- Table structure for table `comments`
 
418
--
 
419
 
 
420
DROP TABLE IF EXISTS `comments`;
 
421
CREATE TABLE `comments` (
 
422
  `sid` bigint NOT NULL default '0',
 
423
  `cid` int NOT NULL auto_increment,
 
424
  `pid` int NOT NULL default '0',
 
425
  `date` datetime NOT NULL,
 
426
  `last_update` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
 
427
  `ipid` varchar(32) NOT NULL default '',
 
428
  `subnetid` varchar(32) NOT NULL default '',
 
429
  `subject` varchar(50) NOT NULL default '',
 
430
  `subject_orig` enum('no','yes') NOT NULL default 'yes',
 
431
  `uid` bigint NOT NULL default '0',
 
432
  `points` int NOT NULL default '0',
 
433
  `pointsorig` int NOT NULL default '0',
 
434
  `pointsmax` int NOT NULL default '0',
 
435
  `f1` float default NULL,
 
436
  `f2` float default NULL,
 
437
  `f3` float default NULL,
 
438
  `f4` float default NULL,
 
439
  `f5` float default NULL,
 
440
  `f6` float default NULL,
 
441
  `lastmod` bigint NOT NULL default '0',
 
442
  `reason` int NOT NULL default '0',
 
443
  `signature` varchar(32) NOT NULL default '',
 
444
  `karma_bonus` enum('yes','no') NOT NULL default 'no',
 
445
  `subscriber_bonus` enum('no','yes') NOT NULL default 'no',
 
446
  `len` int NOT NULL default '0',
 
447
  `karma` int NOT NULL default '0',
 
448
  `karma_abs` int NOT NULL default '0',
 
449
  `tweak_orig` int NOT NULL default '0',
 
450
  `tweak` int NOT NULL default '0',
 
451
  `badge_id` int NOT NULL default '0',
 
452
  PRIMARY KEY  (`cid`),
 
453
  KEY `display` (`sid`,`points`,`uid`),
 
454
  KEY `byname` (`uid`,`points`),
 
455
  KEY `ipid` (`ipid`),
 
456
  KEY `uid` (`uid`),
 
457
  KEY `subnetid` (`subnetid`),
 
458
  KEY `theusual` (`sid`,`uid`,`points`,`cid`),
 
459
  KEY `countreplies` (`pid`,`sid`),
 
460
  KEY `uid_date` (`uid`,`date`),
 
461
  KEY `date_sid` (`date`,`sid`)
 
462
);
 
463
 
 
464
--
 
465
-- Table structure for table `content_filters`
 
466
--
 
467
 
 
468
DROP TABLE IF EXISTS `content_filters`;
 
469
CREATE TABLE `content_filters` (
 
470
  `filter_id` int NOT NULL auto_increment,
 
471
  `form` varchar(20) NOT NULL default '',
 
472
  `regex` varchar(100) NOT NULL default '',
 
473
  `modifier` varchar(5) NOT NULL default '',
 
474
  `field` varchar(20) NOT NULL default '',
 
475
  `ratio` float(6,4) NOT NULL default '0.0000',
 
476
  `minimum_match` bigint NOT NULL default '0',
 
477
  `minimum_length` bigint NOT NULL default '0',
 
478
  `err_message` varchar(150) default '',
 
479
  PRIMARY KEY  (`filter_id`),
 
480
  KEY `form` (`form`),
 
481
  KEY `regex` (`regex`),
 
482
  KEY `field_key` (`field`)
 
483
);
 
484
 
 
485
--
 
486
-- Table structure for table `css`
 
487
--
 
488
 
 
489
DROP TABLE IF EXISTS `css`;
 
490
CREATE TABLE `css` (
 
491
  `csid` int NOT NULL auto_increment,
 
492
  `rel` varchar(32) default 'stylesheet',
 
493
  `type` varchar(32) default 'text/css',
 
494
  `media` varchar(64) default NULL,
 
495
  `file` varchar(64) default NULL,
 
496
  `title` varchar(32) default NULL,
 
497
  `skin` varchar(32) default '',
 
498
  `page` varchar(32) default '',
 
499
  `admin` enum('no','yes') default 'no',
 
500
  `theme` varchar(32) default '',
 
501
  `ctid` int NOT NULL default '0',
 
502
  `ordernum` int default '0',
 
503
  `ie_cond` varchar(16) default '',
 
504
  `lowbandwidth` enum('no','yes') default 'no',
 
505
  `layout` varchar(16) default '',
 
506
  PRIMARY KEY  (`csid`),
 
507
  KEY `ctid` (`ctid`),
 
508
  KEY `page_skin` (`page`,`skin`),
 
509
  KEY `skin_page` (`skin`,`page`),
 
510
  KEY `layout` (`layout`)
 
511
);
 
512
 
 
513
--
 
514
-- Table structure for table `css_type`
 
515
--
 
516
 
 
517
DROP TABLE IF EXISTS `css_type`;
 
518
CREATE TABLE `css_type` (
 
519
  `ctid` int NOT NULL auto_increment,
 
520
  `name` varchar(32) NOT NULL default '',
 
521
  `ordernum` int NOT NULL default '0',
 
522
  PRIMARY KEY  (`ctid`)
 
523
);
 
524
 
 
525
--
 
526
-- Table structure for table `dateformats`
 
527
--
 
528
 
 
529
DROP TABLE IF EXISTS `dateformats`;
 
530
CREATE TABLE `dateformats` (
 
531
  `id` int NOT NULL default '0',
 
532
  `format` varchar(64) default NULL,
 
533
  `description` varchar(64) default NULL,
 
534
  PRIMARY KEY  (`id`)
 
535
);
 
536
 
 
537
--
 
538
-- Table structure for table `daypass_available`
 
539
--
 
540
 
 
541
DROP TABLE IF EXISTS `daypass_available`;
 
542
CREATE TABLE `daypass_available` (
 
543
  `daid` int NOT NULL auto_increment,
 
544
  `adnum` int NOT NULL default '0',
 
545
  `minduration` int NOT NULL default '0',
 
546
  `starttime` datetime NOT NULL,
 
547
  `endtime` datetime NOT NULL,
 
548
  `aclreq` varchar(32) default NULL,
 
549
  PRIMARY KEY  (`daid`)
 
550
);
 
551
 
 
552
--
 
553
-- Table structure for table `daypass_confcodes`
 
554
--
 
555
 
 
556
DROP TABLE IF EXISTS `daypass_confcodes`;
 
557
CREATE TABLE `daypass_confcodes` (
 
558
  `confcode` varchar(20) NOT NULL default '',
 
559
  `gooduntil` datetime NOT NULL,
 
560
  PRIMARY KEY  (`confcode`)
 
561
);
 
562
 
 
563
--
 
564
-- Table structure for table `daypass_keys`
 
565
--
 
566
 
 
567
DROP TABLE IF EXISTS `daypass_keys`;
 
568
CREATE TABLE `daypass_keys` (
 
569
  `dpkid` int NOT NULL auto_increment,
 
570
  `daypasskey` varchar(20) NOT NULL default '',
 
571
  `daid` int NOT NULL default '0',
 
572
  `key_given` datetime NOT NULL,
 
573
  `earliest_confirmable` datetime NOT NULL,
 
574
  `key_confirmed` datetime default NULL,
 
575
  PRIMARY KEY  (`dpkid`),
 
576
  UNIQUE KEY `daypasskey` (`daypasskey`),
 
577
  KEY `key_given` (`key_given`)
 
578
);
 
579
 
 
580
--
 
581
-- Table structure for table `daypass_needs`
 
582
--
 
583
 
 
584
DROP TABLE IF EXISTS `daypass_needs`;
 
585
CREATE TABLE `daypass_needs` (
 
586
  `type` enum('skin','site','article') NOT NULL default 'skin',
 
587
  `data` varchar(255) NOT NULL default '',
 
588
  `starttime` datetime NOT NULL,
 
589
  `endtime` datetime default NULL
 
590
);
 
591
 
 
592
--
 
593
-- Table structure for table `dbs`
 
594
--
 
595
 
 
596
DROP TABLE IF EXISTS `dbs`;
 
597
CREATE TABLE `dbs` (
 
598
  `id` bigint NOT NULL auto_increment,
 
599
  `virtual_user` varchar(100) NOT NULL default '',
 
600
  `isalive` enum('no','yes') NOT NULL default 'no',
 
601
  `type` enum('writer','reader','log','search','log_slave','querylog','sphinx') NOT NULL default 'reader',
 
602
  `weight` int NOT NULL default '1',
 
603
  `weight_adjust` float NOT NULL default '1',
 
604
  PRIMARY KEY  (`id`),
 
605
  UNIQUE KEY `type_vu` (`type`,`virtual_user`)
 
606
);
 
607
 
 
608
--
 
609
-- Table structure for table `dbs_readerstatus`
 
610
--
 
611
 
 
612
DROP TABLE IF EXISTS `dbs_readerstatus`;
 
613
CREATE TABLE `dbs_readerstatus` (
 
614
  `ts` datetime NOT NULL,
 
615
  `dbid` bigint NOT NULL default '0',
 
616
  `was_alive` enum('no','yes') NOT NULL default 'yes',
 
617
  `was_reachable` enum('no','yes') default 'yes',
 
618
  `was_running` enum('no','yes') default 'yes',
 
619
  `slave_lag_secs` float default '0',
 
620
  `query_bog_secs` float default '0',
 
621
  `bog_rsqid` bigint default NULL,
 
622
  `had_weight` int default '1',
 
623
  `had_weight_adjust` float default '1',
 
624
  KEY `ts_dbid` (`ts`,`dbid`)
 
625
);
 
626
 
 
627
--
 
628
-- Table structure for table `dbs_readerstatus_queries`
 
629
--
 
630
 
 
631
DROP TABLE IF EXISTS `dbs_readerstatus_queries`;
 
632
CREATE TABLE `dbs_readerstatus_queries` (
 
633
  `rsqid` bigint NOT NULL auto_increment,
 
634
  `text` varchar(255) default NULL,
 
635
  PRIMARY KEY  (`rsqid`),
 
636
  KEY `text` (`text`)
 
637
);
 
638
 
 
639
--
 
640
-- Table structure for table `discussion_kinds`
 
641
--
 
642
 
 
643
DROP TABLE IF EXISTS `discussion_kinds`;
 
644
CREATE TABLE `discussion_kinds` (
 
645
  `dkid` int NOT NULL auto_increment,
 
646
  `name` varchar(30) NOT NULL default '',
 
647
  PRIMARY KEY  (`dkid`),
 
648
  UNIQUE KEY `name` (`name`)
 
649
);
 
650
 
 
651
--
 
652
-- Table structure for table `discussions`
 
653
--
 
654
 
 
655
DROP TABLE IF EXISTS `discussions`;
 
656
CREATE TABLE `discussions` (
 
657
  `id` bigint NOT NULL auto_increment,
 
658
  `dkid` int NOT NULL default '1',
 
659
  `stoid` bigint NOT NULL default '0',
 
660
  `sid` varchar(16) NOT NULL default '',
 
661
  `title` varchar(128) NOT NULL default '',
 
662
  `url` varchar(255) NOT NULL default '',
 
663
  `topic` int default NULL,
 
664
  `ts` datetime NOT NULL,
 
665
  `type` enum('open','recycle','archived') NOT NULL default 'open',
 
666
  `uid` bigint NOT NULL default '0',
 
667
  `commentcount` int NOT NULL default '0',
 
668
  `flags` enum('ok','delete','dirty') NOT NULL default 'ok',
 
669
  `primaryskid` int default NULL,
 
670
  `last_update` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
 
671
  `approved` int NOT NULL default '0',
 
672
  `commentstatus` enum('disabled','enabled','friends_only','friends_fof_only','no_foe','no_foe_eof','logged_in') NOT NULL default 'enabled',
 
673
  `archivable` enum('no','yes') NOT NULL default 'yes',
 
674
  PRIMARY KEY  (`id`),
 
675
  KEY `stoid` (`stoid`),
 
676
  KEY `sid` (`sid`),
 
677
  KEY `topic` (`topic`),
 
678
  KEY `primaryskid` (`primaryskid`,`ts`),
 
679
  KEY `type` (`type`,`uid`,`ts`)
 
680
);
 
681
 
 
682
--
 
683
-- Table structure for table `dst`
 
684
--
 
685
 
 
686
DROP TABLE IF EXISTS `dst`;
 
687
CREATE TABLE `dst` (
 
688
  `region` varchar(32) NOT NULL default '',
 
689
  `selectable` int NOT NULL default '0',
 
690
  `start_hour` int NOT NULL default '0',
 
691
  `start_wnum` int NOT NULL default '0',
 
692
  `start_wday` int NOT NULL default '0',
 
693
  `start_month` int NOT NULL default '0',
 
694
  `end_hour` int NOT NULL default '0',
 
695
  `end_wnum` int NOT NULL default '0',
 
696
  `end_wday` int NOT NULL default '0',
 
697
  `end_month` int NOT NULL default '0',
 
698
  PRIMARY KEY  (`region`)
 
699
);
 
700
 
 
701
--
 
702
-- Table structure for table `dynamic_blocks`
 
703
--
 
704
 
 
705
DROP TABLE IF EXISTS `dynamic_blocks`;
 
706
CREATE TABLE `dynamic_blocks` (
 
707
  `type_id` int NOT NULL default '0',
 
708
  `type` enum('portal','admin','user') NOT NULL default 'user',
 
709
  `private` enum('yes','no') NOT NULL default 'no',
 
710
  PRIMARY KEY  (`type_id`)
 
711
);
 
712
 
 
713
--
 
714
-- Table structure for table `dynamic_user_blocks`
 
715
--
 
716
 
 
717
DROP TABLE IF EXISTS `dynamic_user_blocks`;
 
718
CREATE TABLE `dynamic_user_blocks` (
 
719
  `bid` bigint NOT NULL auto_increment,
 
720
  `portal_id` bigint NOT NULL default '0',
 
721
  `type_id` int NOT NULL default '0',
 
722
  `uid` bigint NOT NULL default '0',
 
723
  `title` varchar(64) NOT NULL default '',
 
724
  `url` varchar(128) NOT NULL default '',
 
725
  `name` varchar(30) NOT NULL default '',
 
726
  `description` varchar(64) NOT NULL default '',
 
727
  `block` text,
 
728
  `seclev` bigint NOT NULL default '0',
 
729
  `created` datetime NOT NULL,
 
730
  `last_update` datetime NOT NULL,
 
731
  PRIMARY KEY  (`bid`),
 
732
  UNIQUE KEY `name` (`name`),
 
733
  UNIQUE KEY `idx_uid_name` (`uid`,`name`),
 
734
  KEY `idx_typeid` (`type_id`),
 
735
  KEY `idx_portalid` (`portal_id`)
 
736
);
 
737
 
 
738
--
 
739
-- Table structure for table `farm_globjid`
 
740
--
 
741
 
 
742
DROP TABLE IF EXISTS `farm_globjid`;
 
743
CREATE TABLE `farm_globjid` (
 
744
  `globjid` int NOT NULL,
 
745
  `x` int default NULL,
 
746
  `y` int default NULL,
 
747
  PRIMARY KEY  (`globjid`)
 
748
);
 
749
 
 
750
--
 
751
-- Table structure for table `farm_ipid`
 
752
--
 
753
 
 
754
DROP TABLE IF EXISTS `farm_ipid`;
 
755
CREATE TABLE `farm_ipid` (
 
756
  `ipid` varchar(32) NOT NULL default '',
 
757
  PRIMARY KEY  (`ipid`)
 
758
);
 
759
 
 
760
--
 
761
-- Table structure for table `farm_uid`
 
762
--
 
763
 
 
764
DROP TABLE IF EXISTS `farm_uid`;
 
765
CREATE TABLE `farm_uid` (
 
766
  `uid` int NOT NULL,
 
767
  `x` int default NULL,
 
768
  PRIMARY KEY  (`uid`)
 
769
);
 
770
 
 
771
--
 
772
-- Table structure for table `file_queue`
 
773
--
 
774
 
 
775
DROP TABLE IF EXISTS `file_queue`;
 
776
CREATE TABLE `file_queue` (
 
777
  `fqid` int NOT NULL auto_increment,
 
778
  `stoid` bigint default NULL,
 
779
  `fhid` bigint default NULL,
 
780
  `file` varchar(255) default NULL,
 
781
  `action` enum('upload','thumbnails','sprite') default NULL,
 
782
  `blobid` varchar(32) NOT NULL default '',
 
783
  PRIMARY KEY  (`fqid`)
 
784
);
 
785
 
 
786
--
 
787
-- Table structure for table `firehose`
 
788
--
 
789
 
 
790
DROP TABLE IF EXISTS `firehose`;
 
791
CREATE TABLE `firehose` (
 
792
  `id` bigint NOT NULL auto_increment,
 
793
  `uid` bigint NOT NULL default '0',
 
794
  `globjid` int NOT NULL default '0',
 
795
  `discussion` bigint NOT NULL default '0',
 
796
  `type` enum('submission','journal','bookmark','feed','story','vendor','misc','comment','discussion','project','tagname') default 'submission',
 
797
  `createtime` datetime NOT NULL,
 
798
  `popularity` float NOT NULL default '0',
 
799
  `editorpop` float NOT NULL default '0',
 
800
  `neediness` float NOT NULL default '0',
 
801
  `activity` float NOT NULL default '0',
 
802
  `accepted` enum('no','yes') default 'no',
 
803
  `rejected` enum('no','yes') default 'no',
 
804
  `public` enum('no','yes') default 'no',
 
805
  `attention_needed` enum('no','yes') default 'no',
 
806
  `is_spam` enum('no','yes') default 'no',
 
807
  `bayes_spam` enum('no','yes') default 'no',
 
808
  `collateral_spam` enum('no','yes') default 'no',
 
809
  `primaryskid` int default '0',
 
810
  `tid` int default NULL,
 
811
  `srcid` int NOT NULL default '0',
 
812
  `url_id` int NOT NULL default '0',
 
813
  `toptags` varchar(255) default '',
 
814
  `email` varchar(255) NOT NULL default '',
 
815
  `emaildomain` varchar(255) NOT NULL default '',
 
816
  `name` varchar(50) NOT NULL,
 
817
  `dept` varchar(100) NOT NULL default '',
 
818
  `ipid` varchar(32) NOT NULL default '',
 
819
  `subnetid` varchar(32) NOT NULL default '',
 
820
  `category` varchar(30) NOT NULL default '',
 
821
  `nexuslist` varchar(32) NOT NULL default '',
 
822
  `last_update` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
 
823
  `signoffs` varchar(255) NOT NULL default '',
 
824
  `stoid` bigint default '0',
 
825
  `body_length` bigint NOT NULL default '0',
 
826
  `word_count` bigint NOT NULL default '0',
 
827
  `srcname` varchar(32) NOT NULL default '',
 
828
  `mediatype` enum('none','text','video','image','audio') NOT NULL default 'none',
 
829
  `thumb` bigint default NULL,
 
830
  `offmainpage` enum('no','yes') NOT NULL default 'no',
 
831
  `sprite` varchar(128) NOT NULL default '',
 
832
  `sprite_info` text NOT NULL,
 
833
  `preview` enum('no','yes') default 'no',
 
834
  PRIMARY KEY  (`id`),
 
835
  UNIQUE KEY `globjid` (`globjid`),
 
836
  KEY `createtime` (`createtime`),
 
837
  KEY `popularity` (`popularity`),
 
838
  KEY `editorpop` (`editorpop`),
 
839
  KEY `url_id` (`url_id`),
 
840
  KEY `neediness` (`neediness`),
 
841
  KEY `uid` (`uid`),
 
842
  KEY `last_update` (`last_update`),
 
843
  KEY `type_srcid` (`type`,`srcid`)
 
844
);
 
845
 
 
846
--
 
847
-- Table structure for table `firehose_history`
 
848
--
 
849
 
 
850
DROP TABLE IF EXISTS `firehose_history`;
 
851
CREATE TABLE `firehose_history` (
 
852
  `globjid` int NOT NULL default '0',
 
853
  `secsin` int NOT NULL default '0',
 
854
  `userpop` float NOT NULL default '0',
 
855
  `editorpop` float NOT NULL default '0',
 
856
  UNIQUE KEY `globjid_secsin` (`globjid`,`secsin`)
 
857
);
 
858
 
 
859
--
 
860
-- Table structure for table `firehose_ogaspt`
 
861
--
 
862
 
 
863
DROP TABLE IF EXISTS `firehose_ogaspt`;
 
864
CREATE TABLE `firehose_ogaspt` (
 
865
  `globjid` int NOT NULL default '0',
 
866
  `pubtime` datetime NOT NULL,
 
867
  PRIMARY KEY  (`globjid`)
 
868
);
 
869
 
 
870
--
 
871
-- Table structure for table `firehose_section`
 
872
--
 
873
 
 
874
DROP TABLE IF EXISTS `firehose_section`;
 
875
CREATE TABLE `firehose_section` (
 
876
  `fsid` bigint NOT NULL auto_increment,
 
877
  `uid` bigint NOT NULL default '0',
 
878
  `section_name` varchar(32) NOT NULL default 'unnamed',
 
879
  `section_filter` varchar(255) NOT NULL default '',
 
880
  `skid` int NOT NULL default '0',
 
881
  `display` enum('yes','no') default 'yes',
 
882
  `view_id` bigint NOT NULL default '0',
 
883
  `ordernum` int default '0',
 
884
  `section_color` varchar(16) NOT NULL default '',
 
885
  PRIMARY KEY  (`fsid`)
 
886
);
 
887
 
 
888
--
 
889
-- Table structure for table `firehose_section_settings`
 
890
--
 
891
 
 
892
DROP TABLE IF EXISTS `firehose_section_settings`;
 
893
CREATE TABLE `firehose_section_settings` (
 
894
  `id` bigint NOT NULL auto_increment,
 
895
  `fsid` bigint NOT NULL,
 
896
  `uid` bigint NOT NULL default '0',
 
897
  `section_name` varchar(32) NOT NULL default 'unnamed',
 
898
  `section_filter` varchar(255) NOT NULL default '',
 
899
  `display` enum('yes','no') default 'yes',
 
900
  `view_id` bigint NOT NULL default '0',
 
901
  `section_color` varchar(16) NOT NULL default '',
 
902
  PRIMARY KEY  (`id`),
 
903
  UNIQUE KEY `uid_fsid` (`uid`,`fsid`)
 
904
);
 
905
 
 
906
--
 
907
-- Table structure for table `firehose_setting_log`
 
908
--
 
909
 
 
910
DROP TABLE IF EXISTS `firehose_setting_log`;
 
911
CREATE TABLE `firehose_setting_log` (
 
912
  `id` int NOT NULL auto_increment,
 
913
  `uid` bigint NOT NULL default '0',
 
914
  `name` varchar(32) NOT NULL default '',
 
915
  `value` varchar(64) NOT NULL default '',
 
916
  `ts` datetime NOT NULL default '1970-01-01 00:00:00',
 
917
  `ipid` varchar(32) NOT NULL default '',
 
918
  PRIMARY KEY  (`id`)
 
919
);
 
920
 
 
921
--
 
922
-- Table structure for table `firehose_skin_volume`
 
923
--
 
924
 
 
925
DROP TABLE IF EXISTS `firehose_skin_volume`;
 
926
CREATE TABLE `firehose_skin_volume` (
 
927
  `skid` int NOT NULL,
 
928
  `story_vol` bigint NOT NULL default '0',
 
929
  `other_vol` bigint NOT NULL default '0',
 
930
  PRIMARY KEY  (`skid`)
 
931
);
 
932
 
 
933
--
 
934
-- Table structure for table `firehose_tab`
 
935
--
 
936
 
 
937
DROP TABLE IF EXISTS `firehose_tab`;
 
938
CREATE TABLE `firehose_tab` (
 
939
  `tabid` bigint NOT NULL auto_increment,
 
940
  `uid` bigint NOT NULL default '0',
 
941
  `tabname` varchar(16) NOT NULL default 'unnamed',
 
942
  `filter` varchar(255) NOT NULL default '',
 
943
  `orderby` enum('popularity','createtime','editorpop','activity') default 'createtime',
 
944
  `orderdir` enum('ASC','DESC') default 'DESC',
 
945
  `color` varchar(16) NOT NULL default '',
 
946
  `mode` enum('full','fulltitle') default 'fulltitle',
 
947
  PRIMARY KEY  (`tabid`),
 
948
  UNIQUE KEY `uid_tabname` (`uid`,`tabname`)
 
949
);
 
950
 
 
951
--
 
952
-- Table structure for table `firehose_text`
 
953
--
 
954
 
 
955
DROP TABLE IF EXISTS `firehose_text`;
 
956
CREATE TABLE `firehose_text` (
 
957
  `id` bigint NOT NULL,
 
958
  `title` varchar(80) default NULL,
 
959
  `introtext` text,
 
960
  `bodytext` text,
 
961
  `media` text,
 
962
  PRIMARY KEY  (`id`)
 
963
);
 
964
 
 
965
--
 
966
-- Table structure for table `firehose_tfh`
 
967
--
 
968
 
 
969
DROP TABLE IF EXISTS `firehose_tfh`;
 
970
CREATE TABLE `firehose_tfh` (
 
971
  `uid` bigint NOT NULL,
 
972
  `globjid` int NOT NULL,
 
973
  UNIQUE KEY `uid_globjid` (`uid`,`globjid`),
 
974
  KEY `globjid` (`globjid`)
 
975
);
 
976
 
 
977
--
 
978
-- Table structure for table `firehose_tfhp`
 
979
--
 
980
 
 
981
DROP TABLE IF EXISTS `firehose_tfhp`;
 
982
CREATE TABLE `firehose_tfhp` (
 
983
  `uid` bigint NOT NULL,
 
984
  `globjid` int NOT NULL,
 
985
  UNIQUE KEY `uid_globjid` (`uid`,`globjid`),
 
986
  KEY `globjid` (`globjid`)
 
987
);
 
988
 
 
989
--
 
990
-- Table structure for table `firehose_topics_rendered`
 
991
--
 
992
 
 
993
DROP TABLE IF EXISTS `firehose_topics_rendered`;
 
994
CREATE TABLE `firehose_topics_rendered` (
 
995
  `id` bigint NOT NULL,
 
996
  `tid` int NOT NULL,
 
997
  UNIQUE KEY `id_tid` (`id`,`tid`),
 
998
  KEY `tid_id` (`tid`,`id`)
 
999
);
 
1000
 
 
1001
--
 
1002
-- Table structure for table `firehose_update_log`
 
1003
--
 
1004
 
 
1005
DROP TABLE IF EXISTS `firehose_update_log`;
 
1006
CREATE TABLE `firehose_update_log` (
 
1007
  `id` int NOT NULL auto_increment,
 
1008
  `uid` bigint NOT NULL default '0',
 
1009
  `new_count` int NOT NULL default '0',
 
1010
  `update_count` int NOT NULL default '0',
 
1011
  `total_num` int NOT NULL default '0',
 
1012
  `more_num` int NOT NULL default '0',
 
1013
  `ts` datetime NOT NULL default '1970-01-01 00:00:00',
 
1014
  `duration` float NOT NULL default '0',
 
1015
  `bytes` bigint NOT NULL default '0',
 
1016
  `view` varchar(24) NOT NULL default '',
 
1017
  `ipid` varchar(32) NOT NULL default '',
 
1018
  PRIMARY KEY  (`id`)
 
1019
);
 
1020
 
 
1021
--
 
1022
-- Table structure for table `firehose_update_log_temp`
 
1023
--
 
1024
 
 
1025
DROP TABLE IF EXISTS `firehose_update_log_temp`;
 
1026
CREATE TABLE `firehose_update_log_temp` (
 
1027
  `id` int NOT NULL auto_increment,
 
1028
  `uid` bigint NOT NULL default '0',
 
1029
  `new_count` int NOT NULL default '0',
 
1030
  `update_count` int NOT NULL default '0',
 
1031
  `total_num` int NOT NULL default '0',
 
1032
  `more_num` int NOT NULL default '0',
 
1033
  `ts` datetime NOT NULL default '1970-01-01 00:00:00',
 
1034
  `duration` float NOT NULL default '0',
 
1035
  `bytes` bigint NOT NULL default '0',
 
1036
  PRIMARY KEY  (`id`)
 
1037
);
 
1038
 
 
1039
--
 
1040
-- Table structure for table `firehose_view`
 
1041
--
 
1042
 
 
1043
DROP TABLE IF EXISTS `firehose_view`;
 
1044
CREATE TABLE `firehose_view` (
 
1045
  `id` bigint NOT NULL auto_increment,
 
1046
  `uid` bigint NOT NULL default '0',
 
1047
  `viewname` varchar(24) default 'unnamed',
 
1048
  `viewtitle` varchar(24) NOT NULL default '',
 
1049
  `useparentfilter` enum('no','yes') default 'yes',
 
1050
  `tab_display` enum('no','yes') default 'no',
 
1051
  `options_edit` enum('no','yes') default 'no',
 
1052
  `admin_maxitems` int NOT NULL default '-1',
 
1053
  `maxitems` int NOT NULL default '-1',
 
1054
  `seclev` bigint NOT NULL default '0',
 
1055
  `filter` varchar(255) NOT NULL default '',
 
1056
  `orderby` enum('popularity','createtime','editorpop','activity','neediness','') default 'createtime',
 
1057
  `orderdir` enum('ASC','DESC','') default 'DESC',
 
1058
  `color` varchar(16) NOT NULL default '',
 
1059
  `duration` enum('7','-1','') default '',
 
1060
  `mode` enum('full','fulltitle','mixed','') default '',
 
1061
  `pause` enum('1','0','') default '',
 
1062
  `searchbutton` enum('no','yes') default 'yes',
 
1063
  `datafilter` varchar(128) NOT NULL default '',
 
1064
  `admin_unsigned` enum('no','yes') default 'no',
 
1065
  `usermode` enum('no','yes') default 'yes',
 
1066
  `use_exclusions` enum('no','yes') default 'yes',
 
1067
  `editable` enum('no','yes') default 'yes',
 
1068
  `shortcut` enum('yes','no') default 'no',
 
1069
  `short_url` varchar(32) NOT NULL default '',
 
1070
  `link_icon` enum('no','yes') default 'no',
 
1071
  `placeholder` enum('no','yes') default 'no',
 
1072
  `addable` enum('no','yes') default 'no',
 
1073
  `removable` enum('no','yes') default 'no',
 
1074
  PRIMARY KEY  (`id`)
 
1075
);
 
1076
 
 
1077
--
 
1078
-- Table structure for table `firehose_view_settings`
 
1079
--
 
1080
 
 
1081
DROP TABLE IF EXISTS `firehose_view_settings`;
 
1082
CREATE TABLE `firehose_view_settings` (
 
1083
  `uid` bigint NOT NULL default '0',
 
1084
  `id` bigint NOT NULL,
 
1085
  `color` varchar(16) NOT NULL default '',
 
1086
  `orderby` enum('popularity','createtime','editorpop','activity','neediness','') default 'createtime',
 
1087
  `orderdir` enum('ASC','DESC','') default 'DESC',
 
1088
  `mode` enum('full','fulltitle','mixed','') default '',
 
1089
  `datafilter` varchar(128) NOT NULL default '',
 
1090
  `admin_unsigned` enum('no','yes') default 'no',
 
1091
  `usermode` enum('no','yes') default 'yes',
 
1092
  PRIMARY KEY  (`uid`,`id`)
 
1093
);
 
1094
 
 
1095
--
 
1096
-- Table structure for table `formkeys`
 
1097
--
 
1098
 
 
1099
DROP TABLE IF EXISTS `formkeys`;
 
1100
CREATE TABLE `formkeys` (
 
1101
  `formkey` varchar(20) NOT NULL default '',
 
1102
  `formname` varchar(32) NOT NULL default '',
 
1103
  `id` varchar(30) NOT NULL default '',
 
1104
  `uid` bigint NOT NULL default '0',
 
1105
  `ipid` varchar(32) NOT NULL default '',
 
1106
  `value` int NOT NULL default '0',
 
1107
  `ts` int NOT NULL default '0',
 
1108
  `submit_ts` int NOT NULL default '0',
 
1109
  `content_length` int NOT NULL default '0',
 
1110
  `idcount` bigint NOT NULL default '0',
 
1111
  `last_ts` int NOT NULL default '0',
 
1112
  `subnetid` varchar(32) NOT NULL default '',
 
1113
  PRIMARY KEY  (`formkey`),
 
1114
  KEY `formname` (`formname`),
 
1115
  KEY `ts` (`ts`),
 
1116
  KEY `submit_ts` (`submit_ts`),
 
1117
  KEY `idcount` (`idcount`),
 
1118
  KEY `last_ts` (`last_ts`),
 
1119
  KEY `uid` (`uid`),
 
1120
  KEY `subnetid` (`subnetid`),
 
1121
  KEY `ipid` (`ipid`)
 
1122
);
 
1123
 
 
1124
--
 
1125
-- Table structure for table `globj_adminnotes`
 
1126
--
 
1127
 
 
1128
DROP TABLE IF EXISTS `globj_adminnotes`;
 
1129
CREATE TABLE `globj_adminnotes` (
 
1130
  `globjid` int NOT NULL auto_increment,
 
1131
  `adminnote` varchar(255) NOT NULL default '',
 
1132
  PRIMARY KEY  (`globjid`)
 
1133
);
 
1134
 
 
1135
--
 
1136
-- Table structure for table `globj_types`
 
1137
--
 
1138
 
 
1139
DROP TABLE IF EXISTS `globj_types`;
 
1140
CREATE TABLE `globj_types` (
 
1141
  `gtid` int NOT NULL auto_increment,
 
1142
  `maintable` varchar(64) NOT NULL default '',
 
1143
  PRIMARY KEY  (`gtid`),
 
1144
  UNIQUE KEY `maintable` (`maintable`)
 
1145
);
 
1146
 
 
1147
--
 
1148
-- Table structure for table `globj_urls`
 
1149
--
 
1150
 
 
1151
DROP TABLE IF EXISTS `globj_urls`;
 
1152
CREATE TABLE `globj_urls` (
 
1153
  `id` int NOT NULL auto_increment,
 
1154
  `globjid` int NOT NULL default '0',
 
1155
  `url_id` int NOT NULL default '0',
 
1156
  PRIMARY KEY  (`id`),
 
1157
  UNIQUE KEY `globjid_url_id` (`globjid`,`url_id`)
 
1158
);
 
1159
 
 
1160
--
 
1161
-- Table structure for table `globjs`
 
1162
--
 
1163
 
 
1164
DROP TABLE IF EXISTS `globjs`;
 
1165
CREATE TABLE `globjs` (
 
1166
  `globjid` int NOT NULL auto_increment,
 
1167
  `gtid` int NOT NULL default '0',
 
1168
  `target_id` int NOT NULL default '0',
 
1169
  PRIMARY KEY  (`globjid`),
 
1170
  UNIQUE KEY `target` (`gtid`,`target_id`)
 
1171
);
 
1172
 
 
1173
--
 
1174
-- Table structure for table `globjs_viewed`
 
1175
--
 
1176
 
 
1177
DROP TABLE IF EXISTS `globjs_viewed`;
 
1178
CREATE TABLE `globjs_viewed` (
 
1179
  `gvid` int NOT NULL auto_increment,
 
1180
  `globjid` int NOT NULL,
 
1181
  `uid` bigint NOT NULL,
 
1182
  `viewed_at` datetime NOT NULL,
 
1183
  PRIMARY KEY  (`gvid`),
 
1184
  UNIQUE KEY `globjid_uid` (`globjid`,`uid`)
 
1185
);
 
1186
 
 
1187
--
 
1188
-- Table structure for table `globjs_viewed_archived`
 
1189
--
 
1190
 
 
1191
DROP TABLE IF EXISTS `globjs_viewed_archived`;
 
1192
CREATE TABLE `globjs_viewed_archived` (
 
1193
  `gvid` int NOT NULL,
 
1194
  `globjid` int NOT NULL,
 
1195
  `uid` bigint NOT NULL,
 
1196
  `viewed_at` datetime NOT NULL,
 
1197
  PRIMARY KEY  (`gvid`),
 
1198
  UNIQUE KEY `globjid_uid` (`globjid`,`uid`)
 
1199
);
 
1200
 
 
1201
--
 
1202
-- Table structure for table `hooks`
 
1203
--
 
1204
 
 
1205
DROP TABLE IF EXISTS `hooks`;
 
1206
CREATE TABLE `hooks` (
 
1207
  `id` bigint NOT NULL auto_increment,
 
1208
  `param` varchar(50) NOT NULL default '',
 
1209
  `class` varchar(100) NOT NULL default '',
 
1210
  `subroutine` varchar(100) NOT NULL default '',
 
1211
  PRIMARY KEY  (`id`),
 
1212
  UNIQUE KEY `hook_param` (`param`,`class`,`subroutine`)
 
1213
);
 
1214
 
 
1215
--
 
1216
-- Table structure for table `humanconf`
 
1217
--
 
1218
 
 
1219
DROP TABLE IF EXISTS `humanconf`;
 
1220
CREATE TABLE `humanconf` (
 
1221
  `hcid` int NOT NULL auto_increment,
 
1222
  `hcpid` int NOT NULL,
 
1223
  `formkey` varchar(20) NOT NULL default '',
 
1224
  `tries_left` int NOT NULL default '3',
 
1225
  PRIMARY KEY  (`hcid`),
 
1226
  UNIQUE KEY `formkey` (`formkey`),
 
1227
  KEY `hcpid` (`hcpid`)
 
1228
);
 
1229
 
 
1230
--
 
1231
-- Table structure for table `humanconf_pool`
 
1232
--
 
1233
 
 
1234
DROP TABLE IF EXISTS `humanconf_pool`;
 
1235
CREATE TABLE `humanconf_pool` (
 
1236
  `hcpid` int NOT NULL auto_increment,
 
1237
  `hcqid` int NOT NULL default '0',
 
1238
  `answer` char NOT NULL default '',
 
1239
  `lastused` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
 
1240
  `created_at` datetime NOT NULL,
 
1241
  `inuse` int NOT NULL default '0',
 
1242
  `filename_img` varchar(63) NOT NULL,
 
1243
  `filename_mp3` varchar(63) default NULL,
 
1244
  `html` text NOT NULL,
 
1245
  PRIMARY KEY  (`hcpid`),
 
1246
  KEY `answer` (`answer`),
 
1247
  KEY `lastused` (`lastused`)
 
1248
);
 
1249
 
 
1250
--
 
1251
-- Table structure for table `humanconf_questions`
 
1252
--
 
1253
 
 
1254
DROP TABLE IF EXISTS `humanconf_questions`;
 
1255
CREATE TABLE `humanconf_questions` (
 
1256
  `hcqid` int NOT NULL auto_increment,
 
1257
  `filedir` varchar(255) NOT NULL default '',
 
1258
  `urlprefix` varchar(255) NOT NULL default '',
 
1259
  `question` text NOT NULL,
 
1260
  PRIMARY KEY  (`hcqid`)
 
1261
);
 
1262
 
 
1263
--
 
1264
-- Table structure for table `journal_themes`
 
1265
--
 
1266
 
 
1267
DROP TABLE IF EXISTS `journal_themes`;
 
1268
CREATE TABLE `journal_themes` (
 
1269
  `id` int NOT NULL auto_increment,
 
1270
  `name` varchar(30) NOT NULL default '',
 
1271
  PRIMARY KEY  (`id`),
 
1272
  UNIQUE KEY `name` (`name`)
 
1273
);
 
1274
 
 
1275
--
 
1276
-- Table structure for table `journal_transfer`
 
1277
--
 
1278
 
 
1279
DROP TABLE IF EXISTS `journal_transfer`;
 
1280
CREATE TABLE `journal_transfer` (
 
1281
  `id` bigint NOT NULL default '0',
 
1282
  `subid` bigint NOT NULL default '0',
 
1283
  `stoid` bigint NOT NULL default '0',
 
1284
  `updated` int NOT NULL default '0',
 
1285
  PRIMARY KEY  (`id`),
 
1286
  KEY `stoid_updated` (`stoid`,`updated`)
 
1287
);
 
1288
 
 
1289
--
 
1290
-- Table structure for table `journals`
 
1291
--
 
1292
 
 
1293
DROP TABLE IF EXISTS `journals`;
 
1294
CREATE TABLE `journals` (
 
1295
  `id` bigint NOT NULL auto_increment,
 
1296
  `uid` bigint NOT NULL default '0',
 
1297
  `date` datetime NOT NULL,
 
1298
  `description` varchar(80) NOT NULL default '',
 
1299
  `posttype` int NOT NULL default '2',
 
1300
  `discussion` bigint default NULL,
 
1301
  `tid` int NOT NULL default '0',
 
1302
  `last_update` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
 
1303
  `promotetype` enum('publicize','publish','post') NOT NULL default 'publish',
 
1304
  `srcid_32` bigint NOT NULL default '0',
 
1305
  `srcid_24` bigint NOT NULL default '0',
 
1306
  PRIMARY KEY  (`id`),
 
1307
  KEY `uidarticle` (`uid`),
 
1308
  KEY `IDandUID` (`id`,`uid`),
 
1309
  KEY `uid_date_id` (`uid`,`date`,`id`),
 
1310
  KEY `srcid_32` (`srcid_32`),
 
1311
  KEY `srcid_24` (`srcid_24`)
 
1312
);
 
1313
 
 
1314
--
 
1315
-- Table structure for table `journals_text`
 
1316
--
 
1317
 
 
1318
DROP TABLE IF EXISTS `journals_text`;
 
1319
CREATE TABLE `journals_text` (
 
1320
  `id` bigint NOT NULL default '0',
 
1321
  `article` text NOT NULL,
 
1322
  `introtext` text NOT NULL,
 
1323
  PRIMARY KEY  (`id`)
 
1324
);
 
1325
 
 
1326
--
 
1327
-- Table structure for table `links`
 
1328
--
 
1329
 
 
1330
DROP TABLE IF EXISTS `links`;
 
1331
CREATE TABLE `links` (
 
1332
  `id` varchar(32) NOT NULL default '',
 
1333
  `url` text NOT NULL,
 
1334
  `last_seen` datetime NOT NULL,
 
1335
  `is_alive` enum('yes','no') NOT NULL default 'yes',
 
1336
  `stats_type` varchar(24) default NULL,
 
1337
  PRIMARY KEY  (`id`)
 
1338
);
 
1339
 
 
1340
--
 
1341
-- Table structure for table `links_for_stories`
 
1342
--
 
1343
 
 
1344
DROP TABLE IF EXISTS `links_for_stories`;
 
1345
CREATE TABLE `links_for_stories` (
 
1346
  `stoid` bigint NOT NULL,
 
1347
  `id` varchar(32) NOT NULL default '',
 
1348
  `count` int NOT NULL default '0',
 
1349
  PRIMARY KEY  (`id`,`stoid`),
 
1350
  KEY `stoid` (`stoid`)
 
1351
);
 
1352
 
 
1353
--
 
1354
-- Table structure for table `memcached_stats`
 
1355
--
 
1356
 
 
1357
DROP TABLE IF EXISTS `memcached_stats`;
 
1358
CREATE TABLE `memcached_stats` (
 
1359
  `id` int NOT NULL auto_increment,
 
1360
  `ts` datetime NOT NULL,
 
1361
  `secsold` int NOT NULL,
 
1362
  `prefix` varchar(250) NOT NULL default '',
 
1363
  `count` int NOT NULL,
 
1364
  `bytes` int NOT NULL,
 
1365
  `hits` int NOT NULL,
 
1366
  `elapsed` float NOT NULL default '0',
 
1367
  PRIMARY KEY  (`id`),
 
1368
  KEY `ts_prefix` (`ts`,`prefix`),
 
1369
  KEY `prefix_secsold` (`prefix`,`secsold`)
 
1370
);
 
1371
 
 
1372
--
 
1373
-- Table structure for table `menus`
 
1374
--
 
1375
 
 
1376
DROP TABLE IF EXISTS `menus`;
 
1377
CREATE TABLE `menus` (
 
1378
  `id` bigint NOT NULL auto_increment,
 
1379
  `menu` varchar(20) NOT NULL default '',
 
1380
  `label` varchar(255) NOT NULL default '',
 
1381
  `sel_label` varchar(32) NOT NULL default '',
 
1382
  `value` text,
 
1383
  `seclev` bigint NOT NULL default '0',
 
1384
  `showanon` int NOT NULL default '0',
 
1385
  `menuorder` bigint default NULL,
 
1386
  PRIMARY KEY  (`id`),
 
1387
  UNIQUE KEY `page_labels_un` (`menu`,`label`),
 
1388
  KEY `page_labels` (`menu`,`label`)
 
1389
);
 
1390
 
 
1391
--
 
1392
-- Table structure for table `message_codes`
 
1393
--
 
1394
 
 
1395
DROP TABLE IF EXISTS `message_codes`;
 
1396
CREATE TABLE `message_codes` (
 
1397
  `code` int NOT NULL default '0',
 
1398
  `type` varchar(32) NOT NULL default '',
 
1399
  `seclev` int NOT NULL default '1',
 
1400
  `modes` varchar(32) NOT NULL default '',
 
1401
  `subscribe` int NOT NULL default '0',
 
1402
  `send` enum('now','defer','collective') NOT NULL default 'now',
 
1403
  `acl` varchar(32) NOT NULL default '',
 
1404
  `delivery_bvalue` int NOT NULL default '0',
 
1405
  PRIMARY KEY  (`code`)
 
1406
);
 
1407
 
 
1408
--
 
1409
-- Table structure for table `message_deliverymodes`
 
1410
--
 
1411
 
 
1412
DROP TABLE IF EXISTS `message_deliverymodes`;
 
1413
CREATE TABLE `message_deliverymodes` (
 
1414
  `code` int NOT NULL default '0',
 
1415
  `name` varchar(32) NOT NULL default '',
 
1416
  `bitvalue` bigint NOT NULL default '0',
 
1417
  PRIMARY KEY  (`code`)
 
1418
);
 
1419
 
 
1420
--
 
1421
-- Table structure for table `message_drop`
 
1422
--
 
1423
 
 
1424
DROP TABLE IF EXISTS `message_drop`;
 
1425
CREATE TABLE `message_drop` (
 
1426
  `id` int NOT NULL auto_increment,
 
1427
  `user` bigint NOT NULL default '0',
 
1428
  `fuser` bigint NOT NULL default '0',
 
1429
  `code` int NOT NULL default '-1',
 
1430
  `date` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
 
1431
  `altto` varchar(50) NOT NULL default '',
 
1432
  `message` blob NOT NULL,
 
1433
  `send` enum('now','defer','collective') NOT NULL default 'now',
 
1434
  PRIMARY KEY  (`id`)
 
1435
);
 
1436
 
 
1437
--
 
1438
-- Table structure for table `message_log`
 
1439
--
 
1440
 
 
1441
DROP TABLE IF EXISTS `message_log`;
 
1442
CREATE TABLE `message_log` (
 
1443
  `id` int NOT NULL default '0',
 
1444
  `user` bigint NOT NULL default '0',
 
1445
  `fuser` bigint NOT NULL default '0',
 
1446
  `code` int NOT NULL default '-1',
 
1447
  `mode` int NOT NULL default '0',
 
1448
  `date` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP
 
1449
);
 
1450
 
 
1451
--
 
1452
-- Table structure for table `message_web`
 
1453
--
 
1454
 
 
1455
DROP TABLE IF EXISTS `message_web`;
 
1456
CREATE TABLE `message_web` (
 
1457
  `id` int NOT NULL default '0',
 
1458
  `user` bigint NOT NULL default '0',
 
1459
  `fuser` bigint NOT NULL default '0',
 
1460
  `code` int NOT NULL default '-1',
 
1461
  `updated` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
 
1462
  `readed` int NOT NULL default '0',
 
1463
  `date` timestamp NOT NULL,
 
1464
  PRIMARY KEY  (`id`),
 
1465
  KEY `fuser` (`fuser`),
 
1466
  KEY `user` (`user`)
 
1467
);
 
1468
 
 
1469
--
 
1470
-- Table structure for table `message_web_text`
 
1471
--
 
1472
 
 
1473
DROP TABLE IF EXISTS `message_web_text`;
 
1474
CREATE TABLE `message_web_text` (
 
1475
  `id` int NOT NULL default '0',
 
1476
  `subject` blob NOT NULL,
 
1477
  `message` blob NOT NULL,
 
1478
  PRIMARY KEY  (`id`)
 
1479
);
 
1480
 
 
1481
--
 
1482
-- Table structure for table `metamodlog`
 
1483
--
 
1484
 
 
1485
DROP TABLE IF EXISTS `metamodlog`;
 
1486
CREATE TABLE `metamodlog` (
 
1487
  `mmid` int NOT NULL default '0',
 
1488
  `uid` bigint NOT NULL default '0',
 
1489
  `val` int NOT NULL default '0',
 
1490
  `ts` datetime default NULL,
 
1491
  `id` int NOT NULL auto_increment,
 
1492
  `active` int NOT NULL default '1',
 
1493
  PRIMARY KEY  (`id`),
 
1494
  KEY `mmid` (`mmid`),
 
1495
  KEY `byuser` (`uid`)
 
1496
);
 
1497
 
 
1498
--
 
1499
-- Table structure for table `microbin`
 
1500
--
 
1501
 
 
1502
DROP TABLE IF EXISTS `microbin`;
 
1503
CREATE TABLE `microbin` (
 
1504
  `id` bigint NOT NULL auto_increment,
 
1505
  `username` varchar(32) NOT NULL default '',
 
1506
  `src` varchar(64) NOT NULL default '',
 
1507
  `tags` varchar(64) NOT NULL default '',
 
1508
  `ts` datetime NOT NULL default '1970-01-01 00:00:00',
 
1509
  `status` varchar(255) NOT NULL default '',
 
1510
  `active` enum('yes','no') NOT NULL default 'yes',
 
1511
  `introtext` text NOT NULL,
 
1512
  PRIMARY KEY  (`id`),
 
1513
  UNIQUE KEY `status` (`status`)
 
1514
);
 
1515
 
 
1516
--
 
1517
-- Table structure for table `misc_user_opts`
 
1518
--
 
1519
 
 
1520
DROP TABLE IF EXISTS `misc_user_opts`;
 
1521
CREATE TABLE `misc_user_opts` (
 
1522
  `name` varchar(32) NOT NULL default '',
 
1523
  `optorder` bigint default NULL,
 
1524
  `seclev` bigint NOT NULL default '0',
 
1525
  `default_val` text NOT NULL,
 
1526
  `vals_regex` text,
 
1527
  `short_desc` text,
 
1528
  `long_desc` text,
 
1529
  `opts_html` text,
 
1530
  PRIMARY KEY  (`name`)
 
1531
);
 
1532
 
 
1533
--
 
1534
-- Table structure for table `moderatorlog`
 
1535
--
 
1536
 
 
1537
DROP TABLE IF EXISTS `moderatorlog`;
 
1538
CREATE TABLE `moderatorlog` (
 
1539
  `id` int NOT NULL auto_increment,
 
1540
  `ipid` varchar(32) NOT NULL default '',
 
1541
  `subnetid` varchar(32) NOT NULL default '',
 
1542
  `uid` bigint NOT NULL default '0',
 
1543
  `val` int NOT NULL default '0',
 
1544
  `sid` bigint NOT NULL default '0',
 
1545
  `ts` datetime NOT NULL,
 
1546
  `cid` int NOT NULL default '0',
 
1547
  `reason` int default '0',
 
1548
  `active` int NOT NULL default '1',
 
1549
  `spent` int NOT NULL default '1',
 
1550
  `m2count` bigint NOT NULL default '0',
 
1551
  `m2needed` bigint default '0',
 
1552
  `cuid` bigint default NULL,
 
1553
  `m2status` int NOT NULL default '0',
 
1554
  `points_orig` int default NULL,
 
1555
  PRIMARY KEY  (`id`),
 
1556
  KEY `sid` (`sid`,`cid`),
 
1557
  KEY `sid_2` (`cid`,`uid`,`sid`),
 
1558
  KEY `ipid` (`ipid`),
 
1559
  KEY `subnetid` (`subnetid`),
 
1560
  KEY `uid` (`uid`),
 
1561
  KEY `cuid` (`cuid`),
 
1562
  KEY `m2stat_act` (`m2status`,`active`),
 
1563
  KEY `ts_uid_sid` (`ts`,`uid`,`sid`)
 
1564
);
 
1565
 
 
1566
--
 
1567
-- Table structure for table `modreasons`
 
1568
--
 
1569
 
 
1570
DROP TABLE IF EXISTS `modreasons`;
 
1571
CREATE TABLE `modreasons` (
 
1572
  `id` int NOT NULL default '0',
 
1573
  `name` varchar(32) NOT NULL default '',
 
1574
  `m2able` int NOT NULL default '1',
 
1575
  `listable` int NOT NULL default '1',
 
1576
  `val` int NOT NULL default '0',
 
1577
  `karma` int NOT NULL default '0',
 
1578
  `fairfrac` float NOT NULL default '0.5',
 
1579
  `unfairname` varchar(32) NOT NULL default '',
 
1580
  PRIMARY KEY  (`id`)
 
1581
);
 
1582
 
 
1583
--
 
1584
-- Table structure for table `open_proxies`
 
1585
--
 
1586
 
 
1587
DROP TABLE IF EXISTS `open_proxies`;
 
1588
CREATE TABLE `open_proxies` (
 
1589
  `ip` varchar(15) NOT NULL default '',
 
1590
  `port` int NOT NULL default '0',
 
1591
  `dur` float default NULL,
 
1592
  `ts` datetime NOT NULL,
 
1593
  `xff` varchar(40) default NULL,
 
1594
  `ipid` varchar(32) NOT NULL default '',
 
1595
  PRIMARY KEY  (`ip`),
 
1596
  KEY `ts` (`ts`),
 
1597
  KEY `xff` (`xff`),
 
1598
  KEY `ipid` (`ipid`)
 
1599
);
 
1600
 
 
1601
--
 
1602
-- Table structure for table `people`
 
1603
--
 
1604
 
 
1605
DROP TABLE IF EXISTS `people`;
 
1606
CREATE TABLE `people` (
 
1607
  `id` int NOT NULL auto_increment,
 
1608
  `uid` bigint NOT NULL default '0',
 
1609
  `person` bigint NOT NULL default '0',
 
1610
  `type` enum('friend','foe') default NULL,
 
1611
  `perceive` enum('fan','freak') default NULL,
 
1612
  PRIMARY KEY  (`id`),
 
1613
  UNIQUE KEY `degree_of_separation` (`uid`,`person`),
 
1614
  KEY `person` (`person`)
 
1615
);
 
1616
 
 
1617
--
 
1618
-- Table structure for table `pollanswers`
 
1619
--
 
1620
 
 
1621
DROP TABLE IF EXISTS `pollanswers`;
 
1622
CREATE TABLE `pollanswers` (
 
1623
  `qid` bigint NOT NULL default '0',
 
1624
  `aid` bigint NOT NULL default '0',
 
1625
  `answer` varchar(255) default NULL,
 
1626
  `votes` bigint default NULL,
 
1627
  PRIMARY KEY  (`qid`,`aid`)
 
1628
);
 
1629
 
 
1630
--
 
1631
-- Table structure for table `pollquestions`
 
1632
--
 
1633
 
 
1634
DROP TABLE IF EXISTS `pollquestions`;
 
1635
CREATE TABLE `pollquestions` (
 
1636
  `qid` bigint NOT NULL auto_increment,
 
1637
  `question` varchar(255) NOT NULL default '',
 
1638
  `voters` bigint default NULL,
 
1639
  `topic` int NOT NULL,
 
1640
  `discussion` bigint NOT NULL default '0',
 
1641
  `date` datetime default NULL,
 
1642
  `uid` bigint NOT NULL default '0',
 
1643
  `primaryskid` int default NULL,
 
1644
  `autopoll` enum('no','yes') NOT NULL default 'no',
 
1645
  `flags` enum('ok','delete','dirty') NOT NULL default 'ok',
 
1646
  `polltype` enum('nodisplay','section','story') default 'section',
 
1647
  PRIMARY KEY  (`qid`),
 
1648
  KEY `uid` (`uid`),
 
1649
  KEY `discussion` (`discussion`),
 
1650
  KEY `ibfk_converttid_2` (`topic`)
 
1651
);
 
1652
 
 
1653
--
 
1654
-- Table structure for table `pollvoters`
 
1655
--
 
1656
 
 
1657
DROP TABLE IF EXISTS `pollvoters`;
 
1658
CREATE TABLE `pollvoters` (
 
1659
  `qid` bigint NOT NULL default '0',
 
1660
  `id` varchar(35) NOT NULL default '',
 
1661
  `time` datetime default NULL,
 
1662
  `uid` bigint NOT NULL default '0',
 
1663
  KEY `qid` (`qid`,`id`,`uid`)
 
1664
);
 
1665
 
 
1666
--
 
1667
-- Table structure for table `preview`
 
1668
--
 
1669
 
 
1670
DROP TABLE IF EXISTS `preview`;
 
1671
CREATE TABLE `preview` (
 
1672
  `preview_id` bigint NOT NULL auto_increment,
 
1673
  `uid` bigint NOT NULL,
 
1674
  `src_fhid` bigint NOT NULL default '0',
 
1675
  `preview_fhid` bigint NOT NULL default '0',
 
1676
  `introtext` text NOT NULL,
 
1677
  `bodytext` text NOT NULL,
 
1678
  `active` enum('no','yes') default 'yes',
 
1679
  `session` varchar(20) NOT NULL default '',
 
1680
  `createtime` datetime NOT NULL default '1970-01-01 00:00:00',
 
1681
  `title` varchar(255) NOT NULL default '',
 
1682
  PRIMARY KEY  (`preview_id`),
 
1683
  KEY `uid` (`uid`),
 
1684
  KEY `session` (`session`)
 
1685
);
 
1686
 
 
1687
--
 
1688
-- Table structure for table `preview_param`
 
1689
--
 
1690
 
 
1691
DROP TABLE IF EXISTS `preview_param`;
 
1692
CREATE TABLE `preview_param` (
 
1693
  `param_id` bigint NOT NULL auto_increment,
 
1694
  `preview_id` bigint NOT NULL,
 
1695
  `name` varchar(32) NOT NULL default '',
 
1696
  `value` text NOT NULL,
 
1697
  PRIMARY KEY  (`param_id`),
 
1698
  UNIQUE KEY `submission_key` (`preview_id`,`name`)
 
1699
);
 
1700
 
 
1701
--
 
1702
-- Table structure for table `projects`
 
1703
--
 
1704
 
 
1705
DROP TABLE IF EXISTS `projects`;
 
1706
CREATE TABLE `projects` (
 
1707
  `id` bigint NOT NULL auto_increment,
 
1708
  `uid` bigint NOT NULL default '0',
 
1709
  `unixname` varchar(24) NOT NULL default '',
 
1710
  `textname` varchar(64) NOT NULL default '',
 
1711
  `url_id` int NOT NULL default '0',
 
1712
  `createtime` datetime NOT NULL default '1970-01-01 00:00:00',
 
1713
  `srcname` varchar(32) NOT NULL default '0',
 
1714
  `description` text NOT NULL,
 
1715
  PRIMARY KEY  (`id`),
 
1716
  UNIQUE KEY `unixname` (`unixname`)
 
1717
);
 
1718
 
 
1719
--
 
1720
-- Table structure for table `related_links`
 
1721
--
 
1722
 
 
1723
DROP TABLE IF EXISTS `related_links`;
 
1724
CREATE TABLE `related_links` (
 
1725
  `id` int NOT NULL auto_increment,
 
1726
  `keyword` varchar(30) NOT NULL default '',
 
1727
  `name` varchar(80) default NULL,
 
1728
  `link` varchar(128) NOT NULL default '',
 
1729
  PRIMARY KEY  (`id`),
 
1730
  KEY `keyword` (`keyword`)
 
1731
);
 
1732
 
 
1733
--
 
1734
-- Table structure for table `related_stories`
 
1735
--
 
1736
 
 
1737
DROP TABLE IF EXISTS `related_stories`;
 
1738
CREATE TABLE `related_stories` (
 
1739
  `id` bigint NOT NULL auto_increment,
 
1740
  `stoid` bigint default '0',
 
1741
  `rel_stoid` bigint default '0',
 
1742
  `rel_sid` varchar(16) NOT NULL default '',
 
1743
  `title` varchar(255) default '',
 
1744
  `url` varchar(255) default '',
 
1745
  `cid` int NOT NULL default '0',
 
1746
  `ordernum` int NOT NULL default '0',
 
1747
  `fhid` bigint NOT NULL default '0',
 
1748
  PRIMARY KEY  (`id`),
 
1749
  KEY `stoid` (`stoid`)
 
1750
);
 
1751
 
 
1752
--
 
1753
-- Table structure for table `remarks`
 
1754
--
 
1755
 
 
1756
DROP TABLE IF EXISTS `remarks`;
 
1757
CREATE TABLE `remarks` (
 
1758
  `rid` bigint NOT NULL auto_increment,
 
1759
  `uid` bigint NOT NULL default '0',
 
1760
  `stoid` bigint NOT NULL default '0',
 
1761
  `priority` int NOT NULL default '0',
 
1762
  `time` datetime NOT NULL,
 
1763
  `remark` varchar(255) default NULL,
 
1764
  `type` enum('system','user') default 'user',
 
1765
  PRIMARY KEY  (`rid`),
 
1766
  KEY `uid` (`uid`),
 
1767
  KEY `stoid` (`stoid`),
 
1768
  KEY `time` (`time`),
 
1769
  KEY `priority` (`priority`)
 
1770
);
 
1771
 
 
1772
--
 
1773
-- Table structure for table `reskey_failures`
 
1774
--
 
1775
 
 
1776
DROP TABLE IF EXISTS `reskey_failures`;
 
1777
CREATE TABLE `reskey_failures` (
 
1778
  `rkid` int NOT NULL default '0',
 
1779
  `failure` varchar(255) NOT NULL default '',
 
1780
  PRIMARY KEY  (`rkid`)
 
1781
);
 
1782
 
 
1783
--
 
1784
-- Table structure for table `reskey_hourlysalt`
 
1785
--
 
1786
 
 
1787
DROP TABLE IF EXISTS `reskey_hourlysalt`;
 
1788
CREATE TABLE `reskey_hourlysalt` (
 
1789
  `ts` datetime NOT NULL,
 
1790
  `salt` varchar(20) NOT NULL default '',
 
1791
  UNIQUE KEY `ts` (`ts`)
 
1792
);
 
1793
 
 
1794
--
 
1795
-- Table structure for table `reskey_resource_checks`
 
1796
--
 
1797
 
 
1798
DROP TABLE IF EXISTS `reskey_resource_checks`;
 
1799
CREATE TABLE `reskey_resource_checks` (
 
1800
  `rkrcid` int NOT NULL auto_increment,
 
1801
  `rkrid` int NOT NULL default '0',
 
1802
  `type` enum('create','touch','use','all') NOT NULL default 'create',
 
1803
  `class` varchar(255) default NULL,
 
1804
  `ordernum` int default '0',
 
1805
  PRIMARY KEY  (`rkrcid`),
 
1806
  UNIQUE KEY `rkrid_name` (`rkrid`,`type`,`class`)
 
1807
);
 
1808
 
 
1809
--
 
1810
-- Table structure for table `reskey_resources`
 
1811
--
 
1812
 
 
1813
DROP TABLE IF EXISTS `reskey_resources`;
 
1814
CREATE TABLE `reskey_resources` (
 
1815
  `rkrid` int NOT NULL auto_increment,
 
1816
  `name` varchar(64) default NULL,
 
1817
  `static` enum('yes','no') NOT NULL default 'no',
 
1818
  PRIMARY KEY  (`rkrid`)
 
1819
);
 
1820
 
 
1821
--
 
1822
-- Table structure for table `reskey_sessions`
 
1823
--
 
1824
 
 
1825
DROP TABLE IF EXISTS `reskey_sessions`;
 
1826
CREATE TABLE `reskey_sessions` (
 
1827
  `sessid` int NOT NULL auto_increment,
 
1828
  `reskey` varchar(20) NOT NULL default '',
 
1829
  `name` varchar(48) NOT NULL default '',
 
1830
  `value` text,
 
1831
  PRIMARY KEY  (`sessid`),
 
1832
  UNIQUE KEY `reskey_name` (`reskey`,`name`),
 
1833
  KEY `reskey` (`reskey`)
 
1834
);
 
1835
 
 
1836
--
 
1837
-- Table structure for table `reskey_vars`
 
1838
--
 
1839
 
 
1840
DROP TABLE IF EXISTS `reskey_vars`;
 
1841
CREATE TABLE `reskey_vars` (
 
1842
  `rkrid` int NOT NULL default '0',
 
1843
  `name` varchar(48) NOT NULL default '',
 
1844
  `value` text,
 
1845
  `description` varchar(255) default NULL,
 
1846
  UNIQUE KEY `name_rkrid` (`name`,`rkrid`)
 
1847
);
 
1848
 
 
1849
--
 
1850
-- Table structure for table `reskeys`
 
1851
--
 
1852
 
 
1853
DROP TABLE IF EXISTS `reskeys`;
 
1854
CREATE TABLE `reskeys` (
 
1855
  `rkid` int NOT NULL auto_increment,
 
1856
  `reskey` varchar(20) NOT NULL default '',
 
1857
  `rkrid` int NOT NULL default '0',
 
1858
  `uid` bigint NOT NULL default '0',
 
1859
  `srcid_ip` bigint NOT NULL default '0',
 
1860
  `failures` int NOT NULL default '0',
 
1861
  `touches` int NOT NULL default '0',
 
1862
  `is_alive` enum('yes','no') NOT NULL default 'yes',
 
1863
  `create_ts` datetime NOT NULL,
 
1864
  `last_ts` datetime NOT NULL,
 
1865
  `submit_ts` datetime default NULL,
 
1866
  PRIMARY KEY  (`rkid`),
 
1867
  UNIQUE KEY `reskey` (`reskey`),
 
1868
  KEY `rkrid` (`rkrid`),
 
1869
  KEY `uid` (`uid`),
 
1870
  KEY `srcid_ip` (`srcid_ip`),
 
1871
  KEY `create_ts` (`create_ts`),
 
1872
  KEY `last_ts` (`last_ts`),
 
1873
  KEY `submit_ts` (`submit_ts`)
 
1874
);
 
1875
 
 
1876
--
 
1877
-- Table structure for table `rss_raw`
 
1878
--
 
1879
 
 
1880
DROP TABLE IF EXISTS `rss_raw`;
 
1881
CREATE TABLE `rss_raw` (
 
1882
  `id` bigint NOT NULL auto_increment,
 
1883
  `link_signature` varchar(32) NOT NULL default '',
 
1884
  `title_signature` varchar(32) NOT NULL default '',
 
1885
  `description_signature` varchar(32) NOT NULL default '',
 
1886
  `link` varchar(255) NOT NULL default '',
 
1887
  `title` varchar(255) NOT NULL default '',
 
1888
  `description` text,
 
1889
  `subid` bigint default NULL,
 
1890
  `bid` varchar(30) default NULL,
 
1891
  `created` datetime default NULL,
 
1892
  `processed` enum('no','yes') NOT NULL default 'no',
 
1893
  PRIMARY KEY  (`id`),
 
1894
  UNIQUE KEY `uber_signature` (`link_signature`,`title_signature`,`description_signature`),
 
1895
  KEY `processed` (`processed`)
 
1896
);
 
1897
 
 
1898
--
 
1899
-- Table structure for table `search_index_dump`
 
1900
--
 
1901
 
 
1902
DROP TABLE IF EXISTS `search_index_dump`;
 
1903
CREATE TABLE `search_index_dump` (
 
1904
  `iid` int NOT NULL auto_increment,
 
1905
  `id` int NOT NULL,
 
1906
  `type` varchar(32) NOT NULL default '',
 
1907
  `status` enum('new','changed','deleted') NOT NULL default 'new',
 
1908
  PRIMARY KEY  (`iid`)
 
1909
);
 
1910
 
 
1911
--
 
1912
-- Table structure for table `section_extras`
 
1913
--
 
1914
 
 
1915
DROP TABLE IF EXISTS `section_extras`;
 
1916
CREATE TABLE `section_extras` (
 
1917
  `param_id` bigint NOT NULL auto_increment,
 
1918
  `section` varchar(30) NOT NULL default '',
 
1919
  `name` varchar(100) NOT NULL default '',
 
1920
  `value` varchar(100) NOT NULL default '',
 
1921
  `type` enum('text','list','topics') NOT NULL default 'text',
 
1922
  PRIMARY KEY  (`param_id`),
 
1923
  UNIQUE KEY `extra` (`section`,`name`)
 
1924
);
 
1925
 
 
1926
--
 
1927
-- Table structure for table `section_subsections`
 
1928
--
 
1929
 
 
1930
DROP TABLE IF EXISTS `section_subsections`;
 
1931
CREATE TABLE `section_subsections` (
 
1932
  `section` varchar(30) NOT NULL default '',
 
1933
  `subsection` int NOT NULL default '0',
 
1934
  PRIMARY KEY  (`section`,`subsection`)
 
1935
);
 
1936
 
 
1937
--
 
1938
-- Table structure for table `section_topics`
 
1939
--
 
1940
 
 
1941
DROP TABLE IF EXISTS `section_topics`;
 
1942
CREATE TABLE `section_topics` (
 
1943
  `section` varchar(30) NOT NULL default '',
 
1944
  `tid` int NOT NULL default '0',
 
1945
  `type` varchar(16) NOT NULL default 'topic_1',
 
1946
  PRIMARY KEY  (`section`,`type`,`tid`)
 
1947
);
 
1948
 
 
1949
--
 
1950
-- Table structure for table `sections`
 
1951
--
 
1952
 
 
1953
DROP TABLE IF EXISTS `sections`;
 
1954
CREATE TABLE `sections` (
 
1955
  `id` int NOT NULL auto_increment,
 
1956
  `section` varchar(30) NOT NULL default '',
 
1957
  `artcount` bigint NOT NULL default '30',
 
1958
  `title` varchar(64) NOT NULL default '',
 
1959
  `qid` bigint NOT NULL default '0',
 
1960
  `issue` int NOT NULL default '0',
 
1961
  `url` varchar(32) NOT NULL default '',
 
1962
  `hostname` varchar(32) NOT NULL default '',
 
1963
  `index_handler` varchar(30) NOT NULL default 'index.pl',
 
1964
  `writestatus` enum('ok','dirty') NOT NULL default 'ok',
 
1965
  `type` enum('contained','collected') NOT NULL default 'contained',
 
1966
  `rewrite` bigint NOT NULL default '3600',
 
1967
  `last_update` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
 
1968
  `defaultdisplaystatus` int NOT NULL default '0',
 
1969
  `defaulttopic` int NOT NULL default '1',
 
1970
  `defaultsection` varchar(30) default NULL,
 
1971
  `defaultsubsection` int NOT NULL default '0',
 
1972
  `defaultcommentstatus` enum('disabled','enabled','friends_only','friends_fof_only','no_foe','no_foe_eof') NOT NULL default 'enabled',
 
1973
  `cookiedomain` varchar(128) NOT NULL default '',
 
1974
  PRIMARY KEY  (`id`),
 
1975
  UNIQUE KEY `section` (`section`)
 
1976
);
 
1977
 
 
1978
--
 
1979
-- Table structure for table `sections_contained`
 
1980
--
 
1981
 
 
1982
DROP TABLE IF EXISTS `sections_contained`;
 
1983
CREATE TABLE `sections_contained` (
 
1984
  `id` int NOT NULL auto_increment,
 
1985
  `container` varchar(30) NOT NULL default '',
 
1986
  `section` varchar(30) NOT NULL default '',
 
1987
  PRIMARY KEY  (`id`),
 
1988
  UNIQUE KEY `container` (`container`,`section`)
 
1989
);
 
1990
 
 
1991
--
 
1992
-- Table structure for table `sessions`
 
1993
--
 
1994
 
 
1995
DROP TABLE IF EXISTS `sessions`;
 
1996
CREATE TABLE `sessions` (
 
1997
  `session` bigint NOT NULL auto_increment,
 
1998
  `uid` bigint default NULL,
 
1999
  `lasttime` datetime default NULL,
 
2000
  `lasttitle` varchar(50) default NULL,
 
2001
  `last_sid` varchar(16) default NULL,
 
2002
  `last_subid` bigint default NULL,
 
2003
  `last_fhid` bigint default NULL,
 
2004
  `last_action` varchar(16) default NULL,
 
2005
  PRIMARY KEY  (`session`),
 
2006
  UNIQUE KEY `uid` (`uid`)
 
2007
);
 
2008
 
 
2009
--
 
2010
-- Table structure for table `shifts`
 
2011
--
 
2012
 
 
2013
DROP TABLE IF EXISTS `shifts`;
 
2014
CREATE TABLE `shifts` (
 
2015
  `date` datetime default NULL,
 
2016
  `uid` bigint default NULL,
 
2017
  `type` enum('shift','default') default NULL,
 
2018
  `shift` enum('morning','afternoon','evening') default NULL,
 
2019
  `last_changed` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
 
2020
  KEY `byuser` (`uid`),
 
2021
  KEY `bytime` (`last_changed`),
 
2022
  KEY `byshift` (`shift`,`uid`,`type`)
 
2023
);
 
2024
 
 
2025
--
 
2026
-- Table structure for table `shill_ids`
 
2027
--
 
2028
 
 
2029
DROP TABLE IF EXISTS `shill_ids`;
 
2030
CREATE TABLE `shill_ids` (
 
2031
  `shill_id` int NOT NULL default '0',
 
2032
  `user` varchar(16) NOT NULL default '',
 
2033
  `extra` varchar(40) NOT NULL default '',
 
2034
  `skid` int NOT NULL default '0',
 
2035
  PRIMARY KEY  (`shill_id`)
 
2036
);
 
2037
 
 
2038
--
 
2039
-- Table structure for table `signoff`
 
2040
--
 
2041
 
 
2042
DROP TABLE IF EXISTS `signoff`;
 
2043
CREATE TABLE `signoff` (
 
2044
  `soid` bigint NOT NULL auto_increment,
 
2045
  `stoid` bigint NOT NULL default '0',
 
2046
  `uid` bigint NOT NULL default '0',
 
2047
  `signoff_time` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
 
2048
  `signoff_type` varchar(16) NOT NULL default '',
 
2049
  PRIMARY KEY  (`soid`),
 
2050
  KEY `stoid` (`stoid`)
 
2051
);
 
2052
 
 
2053
--
 
2054
-- Table structure for table `site_info`
 
2055
--
 
2056
 
 
2057
DROP TABLE IF EXISTS `site_info`;
 
2058
CREATE TABLE `site_info` (
 
2059
  `param_id` bigint NOT NULL auto_increment,
 
2060
  `name` varchar(50) NOT NULL default '',
 
2061
  `value` varchar(200) NOT NULL default '',
 
2062
  `description` varchar(255) default NULL,
 
2063
  PRIMARY KEY  (`param_id`),
 
2064
  UNIQUE KEY `site_keys` (`name`,`value`)
 
2065
);
 
2066
 
 
2067
--
 
2068
-- Table structure for table `skin_colors`
 
2069
--
 
2070
 
 
2071
DROP TABLE IF EXISTS `skin_colors`;
 
2072
CREATE TABLE `skin_colors` (
 
2073
  `skid` int NOT NULL default '0',
 
2074
  `name` varchar(24) NOT NULL default '',
 
2075
  `skincolor` varchar(12) NOT NULL default '',
 
2076
  UNIQUE KEY `skid_name` (`skid`,`name`)
 
2077
);
 
2078
 
 
2079
--
 
2080
-- Table structure for table `skins`
 
2081
--
 
2082
 
 
2083
DROP TABLE IF EXISTS `skins`;
 
2084
CREATE TABLE `skins` (
 
2085
  `skid` int NOT NULL auto_increment,
 
2086
  `nexus` int NOT NULL,
 
2087
  `artcount_min` bigint NOT NULL default '10',
 
2088
  `artcount_max` bigint NOT NULL default '30',
 
2089
  `name` varchar(30) NOT NULL default '',
 
2090
  `othername` varchar(30) NOT NULL default '',
 
2091
  `title` varchar(64) NOT NULL default '',
 
2092
  `issue` enum('no','yes') NOT NULL default 'no',
 
2093
  `submittable` enum('no','yes') NOT NULL default 'yes',
 
2094
  `searchable` enum('no','yes') NOT NULL default 'yes',
 
2095
  `storypickable` enum('no','yes') NOT NULL default 'yes',
 
2096
  `skinindex` enum('no','yes') NOT NULL default 'yes',
 
2097
  `url` varchar(255) NOT NULL default '',
 
2098
  `hostname` varchar(128) NOT NULL default '',
 
2099
  `cookiedomain` varchar(128) NOT NULL default '',
 
2100
  `index_handler` varchar(30) NOT NULL default 'index.pl',
 
2101
  `max_rewrite_secs` bigint NOT NULL default '3600',
 
2102
  `last_rewrite` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
 
2103
  `ac_uid` bigint NOT NULL default '0',
 
2104
  `older_stories_max` bigint NOT NULL default '0',
 
2105
  `require_acl` varchar(32) NOT NULL default '',
 
2106
  PRIMARY KEY  (`skid`),
 
2107
  UNIQUE KEY `name` (`name`),
 
2108
  KEY `ibfk_converttid_3` (`nexus`)
 
2109
);
 
2110
 
 
2111
--
 
2112
-- Table structure for table `slashd_errnotes`
 
2113
--
 
2114
 
 
2115
DROP TABLE IF EXISTS `slashd_errnotes`;
 
2116
CREATE TABLE `slashd_errnotes` (
 
2117
  `ts` datetime NOT NULL,
 
2118
  `taskname` varchar(50) NOT NULL default 'SLASHD',
 
2119
  `line` bigint NOT NULL default '0',
 
2120
  `errnote` varchar(255) NOT NULL default '',
 
2121
  `moreinfo` text,
 
2122
  KEY `ts` (`ts`),
 
2123
  KEY `taskname_ts` (`taskname`,`ts`)
 
2124
);
 
2125
 
 
2126
--
 
2127
-- Table structure for table `slashd_status`
 
2128
--
 
2129
 
 
2130
DROP TABLE IF EXISTS `slashd_status`;
 
2131
CREATE TABLE `slashd_status` (
 
2132
  `task` varchar(50) NOT NULL default '',
 
2133
  `hostname_regex` varchar(2048) NOT NULL default '',
 
2134
  `next_begin` datetime default NULL,
 
2135
  `in_progress` int NOT NULL default '0',
 
2136
  `last_completed` datetime default NULL,
 
2137
  `summary` varchar(255) NOT NULL default '',
 
2138
  `duration` float(6,2) NOT NULL default '0.00',
 
2139
  PRIMARY KEY  (`task`)
 
2140
);
 
2141
 
 
2142
--
 
2143
-- Table structure for table `soap_methods`
 
2144
--
 
2145
 
 
2146
DROP TABLE IF EXISTS `soap_methods`;
 
2147
CREATE TABLE `soap_methods` (
 
2148
  `id` bigint NOT NULL auto_increment,
 
2149
  `class` varchar(100) NOT NULL default '',
 
2150
  `method` varchar(100) NOT NULL default '',
 
2151
  `seclev` bigint NOT NULL default '1000',
 
2152
  `subscriber_only` int NOT NULL default '0',
 
2153
  `formkeys` varchar(255) NOT NULL default '',
 
2154
  PRIMARY KEY  (`id`),
 
2155
  UNIQUE KEY `soap_method` (`class`,`method`)
 
2156
);
 
2157
 
 
2158
--
 
2159
-- Table structure for table `spamarmors`
 
2160
--
 
2161
 
 
2162
DROP TABLE IF EXISTS `spamarmors`;
 
2163
CREATE TABLE `spamarmors` (
 
2164
  `armor_id` bigint NOT NULL auto_increment,
 
2165
  `name` varchar(40) default NULL,
 
2166
  `code` text,
 
2167
  `active` bigint default '1',
 
2168
  PRIMARY KEY  (`armor_id`)
 
2169
);
 
2170
 
 
2171
--
 
2172
-- Table structure for table `sphinx_counter`
 
2173
--
 
2174
 
 
2175
DROP TABLE IF EXISTS `sphinx_counter`;
 
2176
CREATE TABLE `sphinx_counter` (
 
2177
  `src` int NOT NULL,
 
2178
  `completion` int default NULL,
 
2179
  `last_seen` datetime NOT NULL,
 
2180
  `started` datetime NOT NULL,
 
2181
  `elapsed` int default NULL,
 
2182
  UNIQUE KEY `src_completion` (`src`,`completion`)
 
2183
);
 
2184
 
 
2185
--
 
2186
-- Table structure for table `sphinx_counter_archived`
 
2187
--
 
2188
 
 
2189
DROP TABLE IF EXISTS `sphinx_counter_archived`;
 
2190
CREATE TABLE `sphinx_counter_archived` (
 
2191
  `src` int NOT NULL,
 
2192
  `completion` int NOT NULL,
 
2193
  `last_seen` datetime NOT NULL,
 
2194
  `started` datetime NOT NULL,
 
2195
  `elapsed` int default NULL,
 
2196
  UNIQUE KEY `src_completion` (`src`,`completion`)
 
2197
);
 
2198
 
 
2199
--
 
2200
-- Table structure for table `sphinx_index`
 
2201
--
 
2202
 
 
2203
DROP TABLE IF EXISTS `sphinx_index`;
 
2204
CREATE TABLE `sphinx_index` (
 
2205
  `src` int NOT NULL,
 
2206
  `name` varchar(48) NOT NULL,
 
2207
  `asynch` int NOT NULL default '1',
 
2208
  `laststart` datetime NOT NULL default '2000-01-01 00:00:00',
 
2209
  `frequency` int NOT NULL default '86400',
 
2210
  PRIMARY KEY  (`src`),
 
2211
  UNIQUE KEY `name` (`name`)
 
2212
);
 
2213
 
 
2214
--
 
2215
-- Table structure for table `sphinx_search`
 
2216
--
 
2217
 
 
2218
DROP TABLE IF EXISTS `sphinx_search`;
 
2219
CREATE TABLE `sphinx_search` (
 
2220
  `globjid` int NOT NULL,
 
2221
  `weight` int NOT NULL,
 
2222
  `query` varchar(3072) NOT NULL,
 
2223
  `_sph_count` int NOT NULL,
 
2224
  KEY `query` (`query`(767))
 
2225
);
 
2226
 
 
2227
--
 
2228
-- Table structure for table `static_files`
 
2229
--
 
2230
 
 
2231
DROP TABLE IF EXISTS `static_files`;
 
2232
CREATE TABLE `static_files` (
 
2233
  `sfid` bigint NOT NULL auto_increment,
 
2234
  `stoid` bigint NOT NULL,
 
2235
  `filetype` enum('file','image','audio') NOT NULL default 'file',
 
2236
  `name` varchar(255) NOT NULL default '',
 
2237
  `width` int NOT NULL default '0',
 
2238
  `height` int NOT NULL default '0',
 
2239
  `fhid` bigint NOT NULL,
 
2240
  PRIMARY KEY  (`sfid`),
 
2241
  KEY `stoid` (`stoid`)
 
2242
);
 
2243
 
 
2244
--
 
2245
-- Table structure for table `stats_daily`
 
2246
--
 
2247
 
 
2248
DROP TABLE IF EXISTS `stats_daily`;
 
2249
CREATE TABLE `stats_daily` (
 
2250
  `id` int NOT NULL auto_increment,
 
2251
  `skid` int NOT NULL default '0',
 
2252
  `day` date NOT NULL,
 
2253
  `name` varchar(48) NOT NULL default '',
 
2254
  `value` float NOT NULL default '0',
 
2255
  PRIMARY KEY  (`id`),
 
2256
  UNIQUE KEY `day_key_pair` (`day`,`name`,`skid`),
 
2257
  UNIQUE KEY `skid_day_name` (`skid`,`day`,`name`),
 
2258
  KEY `name_day` (`name`,`day`)
 
2259
);
 
2260
 
 
2261
--
 
2262
-- Table structure for table `stats_graphs_index`
 
2263
--
 
2264
 
 
2265
DROP TABLE IF EXISTS `stats_graphs_index`;
 
2266
CREATE TABLE `stats_graphs_index` (
 
2267
  `day` date NOT NULL,
 
2268
  `md5` varchar(32) NOT NULL default '',
 
2269
  `id` blob
 
2270
);
 
2271
 
 
2272
--
 
2273
-- Table structure for table `stories`
 
2274
--
 
2275
 
 
2276
DROP TABLE IF EXISTS `stories`;
 
2277
CREATE TABLE `stories` (
 
2278
  `stoid` bigint NOT NULL auto_increment,
 
2279
  `sid` varchar(16) NOT NULL default '',
 
2280
  `uid` bigint NOT NULL default '0',
 
2281
  `dept` varchar(100) default NULL,
 
2282
  `time` datetime NOT NULL,
 
2283
  `hits` bigint NOT NULL default '0',
 
2284
  `discussion` bigint default NULL,
 
2285
  `primaryskid` int default NULL,
 
2286
  `tid` int default NULL,
 
2287
  `submitter` bigint NOT NULL default '0',
 
2288
  `commentcount` int NOT NULL default '0',
 
2289
  `hitparade` varchar(64) NOT NULL default '0,0,0,0,0,0,0',
 
2290
  `writestatus` enum('ok','delete','dirty','archived') NOT NULL default 'ok',
 
2291
  `is_archived` enum('no','yes') NOT NULL default 'no',
 
2292
  `in_trash` enum('no','yes') NOT NULL default 'no',
 
2293
  `day_published` date NOT NULL,
 
2294
  `qid` bigint default NULL,
 
2295
  `last_update` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
 
2296
  `body_length` bigint NOT NULL default '0',
 
2297
  `word_count` bigint NOT NULL default '0',
 
2298
  `archive_last_update` datetime NOT NULL default '1970-01-01 00:00:00',
 
2299
  PRIMARY KEY  (`stoid`),
 
2300
  UNIQUE KEY `sid` (`sid`),
 
2301
  KEY `uid` (`uid`),
 
2302
  KEY `is_archived` (`is_archived`),
 
2303
  KEY `time` (`time`),
 
2304
  KEY `submitter` (`submitter`),
 
2305
  KEY `day_published` (`day_published`),
 
2306
  KEY `skidtid` (`primaryskid`,`tid`),
 
2307
  KEY `discussion_stoid` (`discussion`,`stoid`),
 
2308
  KEY `ibfk_converttid_4` (`tid`)
 
2309
);
 
2310
 
 
2311
--
 
2312
-- Table structure for table `stories_media`
 
2313
--
 
2314
 
 
2315
DROP TABLE IF EXISTS `stories_media`;
 
2316
CREATE TABLE `stories_media` (
 
2317
  `smid` int NOT NULL auto_increment,
 
2318
  `sid` varchar(16) default NULL,
 
2319
  `stoid` bigint default '0',
 
2320
  `type` enum('image','audio') default NULL,
 
2321
  `width` int default NULL,
 
2322
  `height` int default NULL,
 
2323
  `location` varchar(255) default NULL,
 
2324
  `name` varchar(255) default NULL,
 
2325
  PRIMARY KEY  (`smid`)
 
2326
);
 
2327
 
 
2328
--
 
2329
-- Table structure for table `story_dirty`
 
2330
--
 
2331
 
 
2332
DROP TABLE IF EXISTS `story_dirty`;
 
2333
CREATE TABLE `story_dirty` (
 
2334
  `stoid` bigint NOT NULL default '0',
 
2335
  PRIMARY KEY  (`stoid`)
 
2336
);
 
2337
 
 
2338
--
 
2339
-- Table structure for table `story_files`
 
2340
--
 
2341
 
 
2342
DROP TABLE IF EXISTS `story_files`;
 
2343
CREATE TABLE `story_files` (
 
2344
  `id` int NOT NULL auto_increment,
 
2345
  `stoid` bigint NOT NULL default '0',
 
2346
  `description` varchar(80) NOT NULL default '',
 
2347
  `file_id` varchar(32) NOT NULL default '',
 
2348
  `isimage` enum('no','yes') NOT NULL default 'no',
 
2349
  PRIMARY KEY  (`id`),
 
2350
  KEY `stoid` (`stoid`),
 
2351
  KEY `file_id` (`file_id`)
 
2352
);
 
2353
 
 
2354
--
 
2355
-- Table structure for table `story_param`
 
2356
--
 
2357
 
 
2358
DROP TABLE IF EXISTS `story_param`;
 
2359
CREATE TABLE `story_param` (
 
2360
  `param_id` bigint NOT NULL auto_increment,
 
2361
  `stoid` bigint NOT NULL default '0',
 
2362
  `name` varchar(32) NOT NULL default '',
 
2363
  `value` text NOT NULL,
 
2364
  PRIMARY KEY  (`param_id`),
 
2365
  UNIQUE KEY `story_key` (`stoid`,`name`)
 
2366
);
 
2367
 
 
2368
--
 
2369
-- Table structure for table `story_render_dirty`
 
2370
--
 
2371
 
 
2372
DROP TABLE IF EXISTS `story_render_dirty`;
 
2373
CREATE TABLE `story_render_dirty` (
 
2374
  `stoid` bigint NOT NULL default '0',
 
2375
  PRIMARY KEY  (`stoid`)
 
2376
);
 
2377
 
 
2378
--
 
2379
-- Table structure for table `story_text`
 
2380
--
 
2381
 
 
2382
DROP TABLE IF EXISTS `story_text`;
 
2383
CREATE TABLE `story_text` (
 
2384
  `stoid` bigint NOT NULL default '0',
 
2385
  `title` varchar(100) NOT NULL default '',
 
2386
  `introtext` text,
 
2387
  `bodytext` text,
 
2388
  `relatedtext` text,
 
2389
  `rendered` text,
 
2390
  PRIMARY KEY  (`stoid`)
 
2391
);
 
2392
 
 
2393
--
 
2394
-- Table structure for table `story_topics_chosen`
 
2395
--
 
2396
 
 
2397
DROP TABLE IF EXISTS `story_topics_chosen`;
 
2398
CREATE TABLE `story_topics_chosen` (
 
2399
  `stoid` bigint NOT NULL default '0',
 
2400
  `tid` int NOT NULL,
 
2401
  `weight` float NOT NULL default '1',
 
2402
  UNIQUE KEY `story_topic` (`stoid`,`tid`),
 
2403
  KEY `tid_stoid` (`tid`,`stoid`)
 
2404
);
 
2405
 
 
2406
--
 
2407
-- Table structure for table `story_topics_rendered`
 
2408
--
 
2409
 
 
2410
DROP TABLE IF EXISTS `story_topics_rendered`;
 
2411
CREATE TABLE `story_topics_rendered` (
 
2412
  `stoid` bigint NOT NULL default '0',
 
2413
  `tid` int NOT NULL,
 
2414
  UNIQUE KEY `story_topic` (`stoid`,`tid`),
 
2415
  KEY `tid_stoid` (`tid`,`stoid`)
 
2416
);
 
2417
 
 
2418
--
 
2419
-- Table structure for table `string_param`
 
2420
--
 
2421
 
 
2422
DROP TABLE IF EXISTS `string_param`;
 
2423
CREATE TABLE `string_param` (
 
2424
  `param_id` int NOT NULL auto_increment,
 
2425
  `type` varchar(32) NOT NULL default '',
 
2426
  `code` varchar(128) NOT NULL default '',
 
2427
  `name` varchar(64) NOT NULL default '',
 
2428
  PRIMARY KEY  (`param_id`),
 
2429
  UNIQUE KEY `code_key` (`type`,`code`)
 
2430
);
 
2431
 
 
2432
--
 
2433
-- Table structure for table `submission_param`
 
2434
--
 
2435
 
 
2436
DROP TABLE IF EXISTS `submission_param`;
 
2437
CREATE TABLE `submission_param` (
 
2438
  `param_id` bigint NOT NULL auto_increment,
 
2439
  `subid` bigint NOT NULL default '0',
 
2440
  `name` varchar(32) NOT NULL default '',
 
2441
  `value` text NOT NULL,
 
2442
  PRIMARY KEY  (`param_id`),
 
2443
  UNIQUE KEY `submission_key` (`subid`,`name`)
 
2444
);
 
2445
 
 
2446
--
 
2447
-- Table structure for table `submissions`
 
2448
--
 
2449
 
 
2450
DROP TABLE IF EXISTS `submissions`;
 
2451
CREATE TABLE `submissions` (
 
2452
  `subid` bigint NOT NULL auto_increment,
 
2453
  `email` varchar(255) NOT NULL default '',
 
2454
  `emaildomain` varchar(255) NOT NULL default '',
 
2455
  `name` varchar(50) NOT NULL default '',
 
2456
  `time` datetime NOT NULL,
 
2457
  `subj` varchar(50) NOT NULL default '',
 
2458
  `story` text NOT NULL,
 
2459
  `tid` int NOT NULL,
 
2460
  `note` varchar(30) NOT NULL default '',
 
2461
  `primaryskid` int default NULL,
 
2462
  `comment` varchar(255) NOT NULL default '',
 
2463
  `uid` bigint NOT NULL default '0',
 
2464
  `ipid` varchar(32) NOT NULL default '',
 
2465
  `subnetid` varchar(32) NOT NULL default '',
 
2466
  `del` int NOT NULL default '0',
 
2467
  `weight` float NOT NULL default '0',
 
2468
  `signature` varchar(32) NOT NULL default '',
 
2469
  `mediatype` enum('none','text','video','image','audio') NOT NULL default 'none',
 
2470
  PRIMARY KEY  (`subid`),
 
2471
  UNIQUE KEY `signature` (`signature`),
 
2472
  KEY `del` (`del`),
 
2473
  KEY `uid` (`uid`),
 
2474
  KEY `ipid` (`ipid`),
 
2475
  KEY `subnetid` (`subnetid`),
 
2476
  KEY `primaryskid_tid` (`primaryskid`,`tid`),
 
2477
  KEY `tid` (`tid`),
 
2478
  KEY `emaildomain` (`emaildomain`),
 
2479
  KEY `time_emaildomain` (`time`,`emaildomain`)
 
2480
);
 
2481
 
 
2482
--
 
2483
-- Table structure for table `submissions_notes`
 
2484
--
 
2485
 
 
2486
DROP TABLE IF EXISTS `submissions_notes`;
 
2487
CREATE TABLE `submissions_notes` (
 
2488
  `noid` bigint NOT NULL auto_increment,
 
2489
  `uid` bigint NOT NULL default '0',
 
2490
  `submatch` varchar(32) NOT NULL default '',
 
2491
  `subnote` text,
 
2492
  `time` datetime default NULL,
 
2493
  PRIMARY KEY  (`noid`)
 
2494
);
 
2495
 
 
2496
--
 
2497
-- Table structure for table `subscribe_payments`
 
2498
--
 
2499
 
 
2500
DROP TABLE IF EXISTS `subscribe_payments`;
 
2501
CREATE TABLE `subscribe_payments` (
 
2502
  `spid` bigint NOT NULL auto_increment,
 
2503
  `uid` bigint NOT NULL default '0',
 
2504
  `email` varchar(255) NOT NULL default '',
 
2505
  `ts` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
 
2506
  `payment_gross` decimal(10,2) NOT NULL default '0.00',
 
2507
  `payment_net` decimal(10,2) NOT NULL default '0.00',
 
2508
  `pages` bigint NOT NULL default '0',
 
2509
  `transaction_id` varchar(255) NOT NULL default '',
 
2510
  `method` varchar(6) default NULL,
 
2511
  `memo` varchar(255) NOT NULL default '',
 
2512
  `data` blob,
 
2513
  `payment_type` varchar(10) default 'user',
 
2514
  `puid` bigint default NULL,
 
2515
  PRIMARY KEY  (`spid`),
 
2516
  UNIQUE KEY `transaction_id` (`transaction_id`),
 
2517
  KEY `uid` (`uid`),
 
2518
  KEY `ts` (`ts`),
 
2519
  KEY `puid` (`puid`)
 
2520
);
 
2521
 
 
2522
--
 
2523
-- Table structure for table `subsections`
 
2524
--
 
2525
 
 
2526
DROP TABLE IF EXISTS `subsections`;
 
2527
CREATE TABLE `subsections` (
 
2528
  `id` int NOT NULL auto_increment,
 
2529
  `title` varchar(30) NOT NULL default '',
 
2530
  `artcount` bigint NOT NULL default '30',
 
2531
  `alttext` varchar(40) NOT NULL default '',
 
2532
  PRIMARY KEY  (`id`),
 
2533
  UNIQUE KEY `code_key` (`title`)
 
2534
);
 
2535
 
 
2536
--
 
2537
-- Table structure for table `surv_answers`
 
2538
--
 
2539
 
 
2540
DROP TABLE IF EXISTS `surv_answers`;
 
2541
CREATE TABLE `surv_answers` (
 
2542
  `sqaid` bigint NOT NULL auto_increment,
 
2543
  `svid` bigint NOT NULL default '0',
 
2544
  `sqid` bigint NOT NULL default '0',
 
2545
  `sqcid` bigint NOT NULL default '0',
 
2546
  `karma` bigint default NULL,
 
2547
  `owneruid` bigint NOT NULL default '0',
 
2548
  `ipaddress` varchar(35) default NULL,
 
2549
  `answer` varchar(255) NOT NULL default '',
 
2550
  `datetimecreated` datetime NOT NULL,
 
2551
  `tokens` bigint default NULL,
 
2552
  `subnetid` varchar(32) default '',
 
2553
  `ipid` varchar(35) default NULL,
 
2554
  PRIMARY KEY  (`sqaid`),
 
2555
  KEY `own` (`owneruid`),
 
2556
  KEY `karma` (`karma`),
 
2557
  KEY `svid` (`svid`),
 
2558
  KEY `sqid` (`sqid`),
 
2559
  KEY `sqcid` (`sqcid`),
 
2560
  KEY `bigboy` (`sqaid`,`owneruid`,`ipaddress`),
 
2561
  KEY `didthey` (`svid`,`sqid`,`owneruid`,`ipaddress`)
 
2562
);
 
2563
 
 
2564
--
 
2565
-- Table structure for table `surv_answers_params`
 
2566
--
 
2567
 
 
2568
DROP TABLE IF EXISTS `surv_answers_params`;
 
2569
CREATE TABLE `surv_answers_params` (
 
2570
  `sqaid` bigint NOT NULL default '0',
 
2571
  `param_id` bigint NOT NULL default '0',
 
2572
  `value` varchar(255) default NULL,
 
2573
  PRIMARY KEY  (`sqaid`,`param_id`)
 
2574
);
 
2575
 
 
2576
--
 
2577
-- Table structure for table `surv_choices`
 
2578
--
 
2579
 
 
2580
DROP TABLE IF EXISTS `surv_choices`;
 
2581
CREATE TABLE `surv_choices` (
 
2582
  `sqcid` bigint NOT NULL auto_increment,
 
2583
  `sqid` bigint NOT NULL default '0',
 
2584
  `ordnum` int NOT NULL default '0',
 
2585
  `name` varchar(255) NOT NULL default '',
 
2586
  `count` bigint NOT NULL default '0',
 
2587
  `datetimecreated` datetime NOT NULL,
 
2588
  `datetimeupdated` datetime NOT NULL,
 
2589
  PRIMARY KEY  (`sqcid`),
 
2590
  KEY `ordnum` (`ordnum`),
 
2591
  KEY `sqid` (`sqid`)
 
2592
);
 
2593
 
 
2594
--
 
2595
-- Table structure for table `surv_questions`
 
2596
--
 
2597
 
 
2598
DROP TABLE IF EXISTS `surv_questions`;
 
2599
CREATE TABLE `surv_questions` (
 
2600
  `sqid` bigint NOT NULL auto_increment,
 
2601
  `svid` bigint NOT NULL default '0',
 
2602
  `next_sqid` bigint default NULL,
 
2603
  `condnext_sqid` bigint default NULL,
 
2604
  `condnext_sqcid` bigint default NULL,
 
2605
  `ordnum` int default '1',
 
2606
  `description` varchar(255) default '',
 
2607
  `type` enum('single_choice_checkboxlist','single_choice_radio','single_choice_pulldown','multi_choice_checkboxlist','multi_choice_pulldown','fill_in_the_blank') default NULL,
 
2608
  `datetimecreated` datetime,
 
2609
  `datetimeupdated` datetime,
 
2610
  PRIMARY KEY  (`sqid`),
 
2611
  KEY `ordnum` (`ordnum`),
 
2612
  KEY `svid` (`svid`),
 
2613
  KEY `squidsvid` (`sqid`,`svid`),
 
2614
  KEY `svidordnum` (`svid`,`ordnum`),
 
2615
  KEY `next_sqid` (`next_sqid`)
 
2616
);
 
2617
 
 
2618
--
 
2619
-- Table structure for table `surv_surveys`
 
2620
--
 
2621
 
 
2622
DROP TABLE IF EXISTS `surv_surveys`;
 
2623
CREATE TABLE `surv_surveys` (
 
2624
  `svid` bigint NOT NULL auto_increment,
 
2625
  `ispublished` enum('yes','no') default 'no',
 
2626
  `requirement` enum('','anon','loggedin','hasmoderated','hasposted','uidrange','seclev','acl_read','acl_write') default '',
 
2627
  `reqval` varchar(32) default '',
 
2628
  `owneruid` int NOT NULL default '0',
 
2629
  `qcount` int default '0',
 
2630
  `skid` int default NULL,
 
2631
  `tid` int default NULL,
 
2632
  `acl_read` varchar(32) default NULL,
 
2633
  `seclev` bigint default NULL,
 
2634
  `discussionid` bigint default NULL,
 
2635
  `datetimecreated` datetime,
 
2636
  `datetimeupdated` datetime,
 
2637
  `datetimeopenned` datetime,
 
2638
  `datetimeopens` datetime,
 
2639
  `datetimeclosed` datetime,
 
2640
  `datetimeexpires` datetime,
 
2641
  `name` varchar(150) NOT NULL default '',
 
2642
  `description` text,
 
2643
  `svsid` varchar(16) NOT NULL default '',
 
2644
  `stoid` bigint default NULL,
 
2645
  `thankyou` text,
 
2646
  `uid_min` bigint default NULL,
 
2647
  `uid_max` bigint default NULL,
 
2648
  PRIMARY KEY  (`svid`),
 
2649
  UNIQUE KEY `svsid` (`svsid`),
 
2650
  KEY `skid` (`skid`),
 
2651
  KEY `owneruid` (`owneruid`),
 
2652
  KEY `acl_read` (`acl_read`),
 
2653
  KEY `ispub` (`ispublished`),
 
2654
  KEY `req` (`requirement`),
 
2655
  KEY `seclev` (`seclev`),
 
2656
  KEY `stoid` (`stoid`),
 
2657
  KEY `tid` (`tid`)
 
2658
);
 
2659
 
 
2660
--
 
2661
-- Table structure for table `surv_surveys_params`
 
2662
--
 
2663
 
 
2664
DROP TABLE IF EXISTS `surv_surveys_params`;
 
2665
CREATE TABLE `surv_surveys_params` (
 
2666
  `param_id` bigint NOT NULL auto_increment,
 
2667
  `svid` bigint NOT NULL default '0',
 
2668
  `name` varchar(30) NOT NULL default '',
 
2669
  `value` text,
 
2670
  PRIMARY KEY  (`param_id`),
 
2671
  KEY `svid` (`svid`)
 
2672
);
 
2673
 
 
2674
--
 
2675
-- Table structure for table `tag_params`
 
2676
--
 
2677
 
 
2678
DROP TABLE IF EXISTS `tag_params`;
 
2679
CREATE TABLE `tag_params` (
 
2680
  `tagid` int NOT NULL,
 
2681
  `name` varchar(32) NOT NULL default '',
 
2682
  `value` varchar(64) NOT NULL default '',
 
2683
  UNIQUE KEY `tag_name` (`tagid`,`name`)
 
2684
);
 
2685
 
 
2686
--
 
2687
-- Table structure for table `tagbox_metamod_history`
 
2688
--
 
2689
 
 
2690
DROP TABLE IF EXISTS `tagbox_metamod_history`;
 
2691
CREATE TABLE `tagbox_metamod_history` (
 
2692
  `globjid` int NOT NULL,
 
2693
  `max_tagid_seen` int NOT NULL,
 
2694
  `last_update` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
 
2695
  PRIMARY KEY  (`globjid`)
 
2696
);
 
2697
 
 
2698
--
 
2699
-- Table structure for table `tagboxes`
 
2700
--
 
2701
 
 
2702
DROP TABLE IF EXISTS `tagboxes`;
 
2703
CREATE TABLE `tagboxes` (
 
2704
  `tbid` int NOT NULL auto_increment,
 
2705
  `name` varchar(32) NOT NULL default '',
 
2706
  `weight` float NOT NULL default '1',
 
2707
  `last_tagid_logged` int NOT NULL,
 
2708
  `last_run_completed` datetime default NULL,
 
2709
  `last_tdid_logged` int NOT NULL,
 
2710
  `last_tuid_logged` int NOT NULL,
 
2711
  PRIMARY KEY  (`tbid`),
 
2712
  UNIQUE KEY `name` (`name`)
 
2713
);
 
2714
 
 
2715
--
 
2716
-- Table structure for table `tagboxlog_feeder`
 
2717
--
 
2718
 
 
2719
DROP TABLE IF EXISTS `tagboxlog_feeder`;
 
2720
CREATE TABLE `tagboxlog_feeder` (
 
2721
  `tfid` int NOT NULL auto_increment,
 
2722
  `created_at` datetime NOT NULL,
 
2723
  `tbid` int NOT NULL,
 
2724
  `affected_id` int NOT NULL,
 
2725
  `importance` float NOT NULL default '1',
 
2726
  `claimed` datetime default NULL,
 
2727
  `tagid` int default NULL,
 
2728
  `tdid` int default NULL,
 
2729
  `tuid` int default NULL,
 
2730
  PRIMARY KEY  (`tfid`),
 
2731
  KEY `tbid_tagid` (`tbid`,`tagid`),
 
2732
  KEY `tbid_affectedid` (`tbid`,`affected_id`),
 
2733
  KEY `tbid_tdid` (`tbid`,`tdid`),
 
2734
  KEY `tbid_tuid` (`tbid`,`tuid`)
 
2735
);
 
2736
 
 
2737
--
 
2738
-- Table structure for table `tagboxlog_feeder_archived`
 
2739
--
 
2740
 
 
2741
DROP TABLE IF EXISTS `tagboxlog_feeder_archived`;
 
2742
CREATE TABLE `tagboxlog_feeder_archived` (
 
2743
  `tfid` int NOT NULL auto_increment,
 
2744
  `created_at` datetime NOT NULL,
 
2745
  `tbid` int NOT NULL,
 
2746
  `affected_id` int NOT NULL,
 
2747
  `importance` float NOT NULL default '1',
 
2748
  `claimed` datetime default NULL,
 
2749
  `tagid` int default NULL,
 
2750
  `tdid` int default NULL,
 
2751
  `tuid` int default NULL,
 
2752
  PRIMARY KEY  (`tfid`),
 
2753
  KEY `tbid_tagid` (`tbid`,`tagid`),
 
2754
  KEY `tbid_affectedid` (`tbid`,`affected_id`),
 
2755
  KEY `tbid_tdid` (`tbid`,`tdid`),
 
2756
  KEY `tbid_tuid` (`tbid`,`tuid`)
 
2757
);
 
2758
 
 
2759
--
 
2760
-- Table structure for table `tagcommand_adminlog`
 
2761
--
 
2762
 
 
2763
DROP TABLE IF EXISTS `tagcommand_adminlog`;
 
2764
CREATE TABLE `tagcommand_adminlog` (
 
2765
  `id` int NOT NULL auto_increment,
 
2766
  `cmdtype` varchar(6) NOT NULL,
 
2767
  `tagnameid` int NOT NULL,
 
2768
  `globjid` int default NULL,
 
2769
  `adminuid` bigint NOT NULL,
 
2770
  `created_at` datetime NOT NULL,
 
2771
  PRIMARY KEY  (`id`),
 
2772
  KEY `created_at` (`created_at`),
 
2773
  KEY `tagnameid_globjid` (`tagnameid`,`globjid`)
 
2774
);
 
2775
 
 
2776
--
 
2777
-- Table structure for table `tagname_cache`
 
2778
--
 
2779
 
 
2780
DROP TABLE IF EXISTS `tagname_cache`;
 
2781
CREATE TABLE `tagname_cache` (
 
2782
  `tagnameid` int NOT NULL,
 
2783
  `tagname` varchar(64) NOT NULL,
 
2784
  `weight` float NOT NULL default '0',
 
2785
  PRIMARY KEY  (`tagnameid`),
 
2786
  UNIQUE KEY `tagname` (`tagname`)
 
2787
);
 
2788
 
 
2789
--
 
2790
-- Table structure for table `tagname_params`
 
2791
--
 
2792
 
 
2793
DROP TABLE IF EXISTS `tagname_params`;
 
2794
CREATE TABLE `tagname_params` (
 
2795
  `tagnameid` int NOT NULL default '0',
 
2796
  `name` varchar(32) NOT NULL default '',
 
2797
  `value` varchar(64) NOT NULL default '',
 
2798
  UNIQUE KEY `tagname_name` (`tagnameid`,`name`),
 
2799
  KEY `name` (`name`)
 
2800
);
 
2801
 
 
2802
--
 
2803
-- Table structure for table `tagnames`
 
2804
--
 
2805
 
 
2806
DROP TABLE IF EXISTS `tagnames`;
 
2807
CREATE TABLE `tagnames` (
 
2808
  `tagnameid` int NOT NULL auto_increment,
 
2809
  `tagname` varchar(64) NOT NULL default '',
 
2810
  PRIMARY KEY  (`tagnameid`),
 
2811
  UNIQUE KEY `tagname` (`tagname`)
 
2812
);
 
2813
 
 
2814
--
 
2815
-- Table structure for table `tagnames_similarity_rendered`
 
2816
--
 
2817
 
 
2818
DROP TABLE IF EXISTS `tagnames_similarity_rendered`;
 
2819
CREATE TABLE `tagnames_similarity_rendered` (
 
2820
  `clid` int NOT NULL default '0',
 
2821
  `syn_tnid` int NOT NULL default '0',
 
2822
  `similarity` enum('1','-1') NOT NULL default '1',
 
2823
  `pref_tnid` int NOT NULL default '0',
 
2824
  UNIQUE KEY `clid_syn_sim` (`clid`,`syn_tnid`,`similarity`)
 
2825
);
 
2826
 
 
2827
--
 
2828
-- Table structure for table `tagnames_synonyms_chosen`
 
2829
--
 
2830
 
 
2831
DROP TABLE IF EXISTS `tagnames_synonyms_chosen`;
 
2832
CREATE TABLE `tagnames_synonyms_chosen` (
 
2833
  `clid` int NOT NULL default '0',
 
2834
  `pref_tnid` int NOT NULL default '0',
 
2835
  `syn_tnid` int NOT NULL default '0',
 
2836
  UNIQUE KEY `clid_pref_syn` (`clid`,`pref_tnid`,`syn_tnid`)
 
2837
);
 
2838
 
 
2839
--
 
2840
-- Table structure for table `tags`
 
2841
--
 
2842
 
 
2843
DROP TABLE IF EXISTS `tags`;
 
2844
CREATE TABLE `tags` (
 
2845
  `tagid` int NOT NULL auto_increment,
 
2846
  `tagnameid` int NOT NULL default '0',
 
2847
  `globjid` int NOT NULL default '0',
 
2848
  `uid` bigint NOT NULL default '0',
 
2849
  `created_at` datetime NOT NULL,
 
2850
  `inactivated` datetime default NULL,
 
2851
  `private` enum('yes','no') NOT NULL default 'no',
 
2852
  PRIMARY KEY  (`tagid`),
 
2853
  KEY `tagnameid` (`tagnameid`),
 
2854
  KEY `globjid_tagnameid` (`globjid`,`tagnameid`),
 
2855
  KEY `created_at` (`created_at`),
 
2856
  KEY `uid_tagnameid_globjid_inactivated` (`uid`,`tagnameid`,`globjid`,`inactivated`)
 
2857
);
 
2858
 
 
2859
--
 
2860
-- Table structure for table `tags_dayofweek`
 
2861
--
 
2862
 
 
2863
DROP TABLE IF EXISTS `tags_dayofweek`;
 
2864
CREATE TABLE `tags_dayofweek` (
 
2865
  `day` int NOT NULL default '0',
 
2866
  `proportion` float NOT NULL default '0',
 
2867
  PRIMARY KEY  (`day`)
 
2868
);
 
2869
 
 
2870
--
 
2871
-- Table structure for table `tags_deactivated`
 
2872
--
 
2873
 
 
2874
DROP TABLE IF EXISTS `tags_deactivated`;
 
2875
CREATE TABLE `tags_deactivated` (
 
2876
  `tdid` int NOT NULL auto_increment,
 
2877
  `tagid` int NOT NULL,
 
2878
  PRIMARY KEY  (`tdid`),
 
2879
  KEY `tagid` (`tagid`)
 
2880
);
 
2881
 
 
2882
--
 
2883
-- Table structure for table `tags_hourofday`
 
2884
--
 
2885
 
 
2886
DROP TABLE IF EXISTS `tags_hourofday`;
 
2887
CREATE TABLE `tags_hourofday` (
 
2888
  `hour` int NOT NULL default '0',
 
2889
  `proportion` float NOT NULL default '0',
 
2890
  PRIMARY KEY  (`hour`)
 
2891
);
 
2892
 
 
2893
--
 
2894
-- Table structure for table `tags_peerclout`
 
2895
--
 
2896
 
 
2897
DROP TABLE IF EXISTS `tags_peerclout`;
 
2898
CREATE TABLE `tags_peerclout` (
 
2899
  `tpcid` int NOT NULL auto_increment,
 
2900
  `uid` bigint NOT NULL default '0',
 
2901
  `clid` int NOT NULL,
 
2902
  `gen` int NOT NULL default '0',
 
2903
  `clout` float NOT NULL default '0',
 
2904
  PRIMARY KEY  (`tpcid`),
 
2905
  UNIQUE KEY `uid_clid` (`uid`,`clid`),
 
2906
  KEY `clid_gen_uid` (`clid`,`gen`,`uid`)
 
2907
);
 
2908
 
 
2909
--
 
2910
-- Table structure for table `tags_searched`
 
2911
--
 
2912
 
 
2913
DROP TABLE IF EXISTS `tags_searched`;
 
2914
CREATE TABLE `tags_searched` (
 
2915
  `tseid` int NOT NULL auto_increment,
 
2916
  `tagnameid` int NOT NULL,
 
2917
  `searched_at` datetime NOT NULL,
 
2918
  `uid` bigint default NULL,
 
2919
  PRIMARY KEY  (`tseid`),
 
2920
  KEY `tagnameid` (`tagnameid`),
 
2921
  KEY `searched_at` (`searched_at`)
 
2922
);
 
2923
 
 
2924
--
 
2925
-- Table structure for table `tags_udc`
 
2926
--
 
2927
 
 
2928
DROP TABLE IF EXISTS `tags_udc`;
 
2929
CREATE TABLE `tags_udc` (
 
2930
  `hourtime` datetime NOT NULL,
 
2931
  `udc` float NOT NULL default '0',
 
2932
  PRIMARY KEY  (`hourtime`)
 
2933
);
 
2934
 
 
2935
--
 
2936
-- Table structure for table `tags_userchange`
 
2937
--
 
2938
 
 
2939
DROP TABLE IF EXISTS `tags_userchange`;
 
2940
CREATE TABLE `tags_userchange` (
 
2941
  `tuid` int NOT NULL auto_increment,
 
2942
  `created_at` datetime NOT NULL,
 
2943
  `uid` bigint NOT NULL,
 
2944
  `user_key` varchar(32) NOT NULL,
 
2945
  `value_old` text,
 
2946
  `value_new` text,
 
2947
  PRIMARY KEY  (`tuid`),
 
2948
  KEY `uid` (`uid`)
 
2949
);
 
2950
 
 
2951
--
 
2952
-- Table structure for table `templates`
 
2953
--
 
2954
 
 
2955
DROP TABLE IF EXISTS `templates`;
 
2956
CREATE TABLE `templates` (
 
2957
  `tpid` bigint NOT NULL auto_increment,
 
2958
  `name` varchar(30) NOT NULL default '',
 
2959
  `page` varchar(20) NOT NULL default 'misc',
 
2960
  `skin` varchar(30) NOT NULL default 'default',
 
2961
  `lang` varchar(5) NOT NULL default 'en_US',
 
2962
  `template` text,
 
2963
  `seclev` bigint NOT NULL default '0',
 
2964
  `description` text,
 
2965
  `title` varchar(128) default NULL,
 
2966
  `last_update` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
 
2967
  PRIMARY KEY  (`tpid`),
 
2968
  UNIQUE KEY `true_template` (`name`,`page`,`skin`,`lang`)
 
2969
);
 
2970
 
 
2971
--
 
2972
-- Table structure for table `topic_nexus`
 
2973
--
 
2974
 
 
2975
DROP TABLE IF EXISTS `topic_nexus`;
 
2976
CREATE TABLE `topic_nexus` (
 
2977
  `tid` int NOT NULL,
 
2978
  `current_qid` bigint default NULL,
 
2979
  PRIMARY KEY  (`tid`)
 
2980
);
 
2981
 
 
2982
--
 
2983
-- Table structure for table `topic_nexus_dirty`
 
2984
--
 
2985
 
 
2986
DROP TABLE IF EXISTS `topic_nexus_dirty`;
 
2987
CREATE TABLE `topic_nexus_dirty` (
 
2988
  `tid` int NOT NULL,
 
2989
  PRIMARY KEY  (`tid`)
 
2990
);
 
2991
 
 
2992
--
 
2993
-- Table structure for table `topic_nexus_extras`
 
2994
--
 
2995
 
 
2996
DROP TABLE IF EXISTS `topic_nexus_extras`;
 
2997
CREATE TABLE `topic_nexus_extras` (
 
2998
  `extras_id` bigint NOT NULL auto_increment,
 
2999
  `tid` int NOT NULL,
 
3000
  `extras_keyword` varchar(100) NOT NULL default '',
 
3001
  `extras_textname` varchar(100) NOT NULL default '',
 
3002
  `type` enum('text','list','textarea') NOT NULL default 'text',
 
3003
  `content_type` enum('story','comment') NOT NULL default 'story',
 
3004
  `required` enum('no','yes') NOT NULL default 'no',
 
3005
  `ordering` int NOT NULL default '0',
 
3006
  PRIMARY KEY  (`extras_id`),
 
3007
  UNIQUE KEY `tid_keyword` (`tid`,`extras_keyword`)
 
3008
);
 
3009
 
 
3010
--
 
3011
-- Table structure for table `topic_param`
 
3012
--
 
3013
 
 
3014
DROP TABLE IF EXISTS `topic_param`;
 
3015
CREATE TABLE `topic_param` (
 
3016
  `param_id` bigint NOT NULL auto_increment,
 
3017
  `tid` int NOT NULL,
 
3018
  `name` varchar(32) NOT NULL default '',
 
3019
  `value` text NOT NULL,
 
3020
  PRIMARY KEY  (`param_id`),
 
3021
  UNIQUE KEY `topic_key` (`tid`,`name`)
 
3022
);
 
3023
 
 
3024
--
 
3025
-- Table structure for table `topic_parents`
 
3026
--
 
3027
 
 
3028
DROP TABLE IF EXISTS `topic_parents`;
 
3029
CREATE TABLE `topic_parents` (
 
3030
  `tid` int NOT NULL,
 
3031
  `parent_tid` int NOT NULL,
 
3032
  `min_weight` float NOT NULL default '1',
 
3033
  UNIQUE KEY `child_and_parent` (`tid`,`parent_tid`),
 
3034
  KEY `parent_tid` (`parent_tid`)
 
3035
);
 
3036
 
 
3037
--
 
3038
-- Table structure for table `topics`
 
3039
--
 
3040
 
 
3041
DROP TABLE IF EXISTS `topics`;
 
3042
CREATE TABLE `topics` (
 
3043
  `tid` int NOT NULL auto_increment,
 
3044
  `keyword` varchar(20) NOT NULL default '',
 
3045
  `textname` varchar(80) NOT NULL default '',
 
3046
  `series` enum('no','yes') NOT NULL default 'no',
 
3047
  `image` varchar(100) NOT NULL default '',
 
3048
  `width` int NOT NULL default '0',
 
3049
  `height` int NOT NULL default '0',
 
3050
  `submittable` enum('no','yes') default 'yes',
 
3051
  `searchable` enum('no','yes') NOT NULL default 'yes',
 
3052
  `storypickable` enum('no','yes') NOT NULL default 'yes',
 
3053
  `usesprite` enum('no','yes') NOT NULL default 'no',
 
3054
  PRIMARY KEY  (`tid`),
 
3055
  UNIQUE KEY `keyword` (`keyword`)
 
3056
);
 
3057
 
 
3058
--
 
3059
-- Table structure for table `topics_changetid`
 
3060
--
 
3061
 
 
3062
DROP TABLE IF EXISTS `topics_changetid`;
 
3063
CREATE TABLE `topics_changetid` (
 
3064
  `tid_old` int NOT NULL,
 
3065
  `tagnameid_new` int NOT NULL,
 
3066
  PRIMARY KEY  (`tid_old`)
 
3067
);
 
3068
 
 
3069
--
 
3070
-- Table structure for table `tzcodes`
 
3071
--
 
3072
 
 
3073
DROP TABLE IF EXISTS `tzcodes`;
 
3074
CREATE TABLE `tzcodes` (
 
3075
  `tz` varchar(4) NOT NULL default '',
 
3076
  `off_set` bigint NOT NULL default '0',
 
3077
  `description` varchar(64) default NULL,
 
3078
  `dst_region` varchar(32) default NULL,
 
3079
  `dst_tz` varchar(4) default NULL,
 
3080
  `dst_off_set` bigint default NULL,
 
3081
  PRIMARY KEY  (`tz`)
 
3082
);
 
3083
 
 
3084
--
 
3085
-- Table structure for table `uncommonstorywords`
 
3086
--
 
3087
 
 
3088
DROP TABLE IF EXISTS `uncommonstorywords`;
 
3089
CREATE TABLE `uncommonstorywords` (
 
3090
  `word` varchar(255) NOT NULL default '',
 
3091
  PRIMARY KEY  (`word`)
 
3092
);
 
3093
 
 
3094
--
 
3095
-- Table structure for table `urls`
 
3096
--
 
3097
 
 
3098
DROP TABLE IF EXISTS `urls`;
 
3099
CREATE TABLE `urls` (
 
3100
  `url_id` int NOT NULL auto_increment,
 
3101
  `url_digest` varchar(32) NOT NULL,
 
3102
  `url` text NOT NULL,
 
3103
  `is_success` int default NULL,
 
3104
  `createtime` datetime default NULL,
 
3105
  `last_attempt` datetime default NULL,
 
3106
  `last_success` datetime default NULL,
 
3107
  `believed_fresh_until` datetime default NULL,
 
3108
  `status_code` int default NULL,
 
3109
  `reason_phrase` varchar(30) default NULL,
 
3110
  `content_type` varchar(60) default NULL,
 
3111
  `initialtitle` varchar(255) default NULL,
 
3112
  `validatedtitle` varchar(255) default NULL,
 
3113
  `tags_top` varchar(255) NOT NULL default '',
 
3114
  `popularity` float NOT NULL default '0',
 
3115
  `anon_bookmarks` bigint NOT NULL default '0',
 
3116
  PRIMARY KEY  (`url_id`),
 
3117
  UNIQUE KEY `url_digest` (`url_digest`),
 
3118
  KEY `bfu` (`believed_fresh_until`)
 
3119
);
 
3120
 
 
3121
--
 
3122
-- Table structure for table `user_achievement_streaks`
 
3123
--
 
3124
 
 
3125
DROP TABLE IF EXISTS `user_achievement_streaks`;
 
3126
CREATE TABLE `user_achievement_streaks` (
 
3127
  `id` bigint NOT NULL auto_increment,
 
3128
  `uid` bigint NOT NULL default '0',
 
3129
  `aid` bigint NOT NULL default '0',
 
3130
  `streak` bigint NOT NULL default '0',
 
3131
  `last_hit` datetime NOT NULL,
 
3132
  PRIMARY KEY  (`id`),
 
3133
  UNIQUE KEY `achievement` (`uid`,`aid`)
 
3134
);
 
3135
 
 
3136
--
 
3137
-- Table structure for table `user_achievements`
 
3138
--
 
3139
 
 
3140
DROP TABLE IF EXISTS `user_achievements`;
 
3141
CREATE TABLE `user_achievements` (
 
3142
  `id` bigint NOT NULL auto_increment,
 
3143
  `uid` bigint NOT NULL default '0',
 
3144
  `aid` bigint NOT NULL default '0',
 
3145
  `exponent` int NOT NULL default '0',
 
3146
  `createtime` datetime NOT NULL,
 
3147
  PRIMARY KEY  (`id`),
 
3148
  UNIQUE KEY `achievement` (`uid`,`aid`),
 
3149
  KEY `aid_exponent` (`aid`,`exponent`)
 
3150
);
 
3151
 
 
3152
--
 
3153
-- Table structure for table `users`
 
3154
--
 
3155
 
 
3156
DROP TABLE IF EXISTS `users`;
 
3157
CREATE TABLE `users` (
 
3158
  `uid` bigint NOT NULL auto_increment,
 
3159
  `nickname` varchar(20) NOT NULL default '',
 
3160
  `realemail` varchar(50) NOT NULL default '',
 
3161
  `fakeemail` varchar(50) default NULL,
 
3162
  `homepage` varchar(100) default NULL,
 
3163
  `passwd` varchar(32) NOT NULL default '',
 
3164
  `sig` varchar(200) default NULL,
 
3165
  `seclev` bigint NOT NULL default '0',
 
3166
  `matchname` varchar(20) default NULL,
 
3167
  `newpasswd` varchar(32) default '',
 
3168
  `newpasswd_ts` datetime default NULL,
 
3169
  `journal_last_entry_date` datetime default NULL,
 
3170
  `author` int NOT NULL default '0',
 
3171
  `shill_id` int NOT NULL default '0',
 
3172
  PRIMARY KEY  (`uid`),
 
3173
  KEY `chk4matchname` (`matchname`),
 
3174
  KEY `author_lookup` (`author`),
 
3175
  KEY `login` (`nickname`,`uid`,`passwd`),
 
3176
  KEY `chk4user` (`realemail`,`nickname`),
 
3177
  KEY `seclev` (`seclev`)
 
3178
);
 
3179
 
 
3180
--
 
3181
-- Table structure for table `users_acl`
 
3182
--
 
3183
 
 
3184
DROP TABLE IF EXISTS `users_acl`;
 
3185
CREATE TABLE `users_acl` (
 
3186
  `id` bigint NOT NULL auto_increment,
 
3187
  `uid` bigint NOT NULL default '0',
 
3188
  `acl` varchar(32) NOT NULL default '',
 
3189
  PRIMARY KEY  (`id`),
 
3190
  UNIQUE KEY `uid_key` (`uid`,`acl`),
 
3191
  KEY `uid` (`uid`)
 
3192
);
 
3193
 
 
3194
--
 
3195
-- Table structure for table `users_clout`
 
3196
--
 
3197
 
 
3198
DROP TABLE IF EXISTS `users_clout`;
 
3199
CREATE TABLE `users_clout` (
 
3200
  `clout_id` int NOT NULL auto_increment,
 
3201
  `uid` bigint NOT NULL,
 
3202
  `clid` int NOT NULL,
 
3203
  `clout` float default NULL,
 
3204
  PRIMARY KEY  (`clout_id`),
 
3205
  UNIQUE KEY `uid_clid` (`uid`,`clid`),
 
3206
  KEY `clid` (`clid`)
 
3207
);
 
3208
 
 
3209
--
 
3210
-- Table structure for table `users_comments`
 
3211
--
 
3212
 
 
3213
DROP TABLE IF EXISTS `users_comments`;
 
3214
CREATE TABLE `users_comments` (
 
3215
  `uid` bigint NOT NULL default '0',
 
3216
  `points` int NOT NULL default '0',
 
3217
  `posttype` bigint NOT NULL default '2',
 
3218
  `defaultpoints` int NOT NULL default '1',
 
3219
  `highlightthresh` int NOT NULL default '4',
 
3220
  `maxcommentsize` int NOT NULL default '4096',
 
3221
  `hardthresh` int NOT NULL default '0',
 
3222
  `clbig` int NOT NULL default '0',
 
3223
  `clsmall` int NOT NULL default '0',
 
3224
  `reparent` int NOT NULL default '1',
 
3225
  `nosigs` int NOT NULL default '0',
 
3226
  `commentlimit` int NOT NULL default '100',
 
3227
  `commentspill` int NOT NULL default '50',
 
3228
  `commentsort` int NOT NULL default '0',
 
3229
  `noscores` int NOT NULL default '0',
 
3230
  `mode` enum('flat','nested','nocomment','thread') NOT NULL default 'thread',
 
3231
  `threshold` int NOT NULL default '1',
 
3232
  PRIMARY KEY  (`uid`),
 
3233
  KEY `points` (`points`)
 
3234
);
 
3235
 
 
3236
--
 
3237
-- Table structure for table `users_comments_read_log`
 
3238
--
 
3239
 
 
3240
DROP TABLE IF EXISTS `users_comments_read_log`;
 
3241
CREATE TABLE `users_comments_read_log` (
 
3242
  `uid` bigint NOT NULL,
 
3243
  `discussion_id` bigint NOT NULL,
 
3244
  `cid` int NOT NULL,
 
3245
  UNIQUE KEY `discussion_id` (`discussion_id`,`uid`,`cid`)
 
3246
);
 
3247
 
 
3248
--
 
3249
-- Table structure for table `users_hits`
 
3250
--
 
3251
 
 
3252
DROP TABLE IF EXISTS `users_hits`;
 
3253
CREATE TABLE `users_hits` (
 
3254
  `uid` bigint NOT NULL default '0',
 
3255
  `lastclick` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
 
3256
  `hits` int NOT NULL default '0',
 
3257
  `hits_bought` int NOT NULL default '0',
 
3258
  `hits_bought_today` int NOT NULL default '0',
 
3259
  `hits_paidfor` int NOT NULL default '0',
 
3260
  PRIMARY KEY  (`uid`)
 
3261
);
 
3262
 
 
3263
--
 
3264
-- Table structure for table `users_index`
 
3265
--
 
3266
 
 
3267
DROP TABLE IF EXISTS `users_index`;
 
3268
CREATE TABLE `users_index` (
 
3269
  `uid` bigint NOT NULL default '0',
 
3270
  `story_never_topic` text NOT NULL,
 
3271
  `story_never_author` varchar(255) NOT NULL default '',
 
3272
  `story_never_nexus` varchar(255) NOT NULL default '',
 
3273
  `slashboxes` text NOT NULL,
 
3274
  `maxstories` int NOT NULL default '30',
 
3275
  `noboxes` int NOT NULL default '0',
 
3276
  `story_always_topic` text NOT NULL,
 
3277
  `story_always_author` varchar(255) NOT NULL default '',
 
3278
  `story_always_nexus` varchar(255) NOT NULL default '',
 
3279
  `story_brief_best_nexus` varchar(255) NOT NULL default '',
 
3280
  `story_full_brief_nexus` varchar(255) NOT NULL default '',
 
3281
  `story_brief_always_nexus` varchar(255) NOT NULL default '',
 
3282
  `story_full_best_nexus` varchar(255) NOT NULL default '',
 
3283
  PRIMARY KEY  (`uid`)
 
3284
);
 
3285
 
 
3286
--
 
3287
-- Table structure for table `users_info`
 
3288
--
 
3289
 
 
3290
DROP TABLE IF EXISTS `users_info`;
 
3291
CREATE TABLE `users_info` (
 
3292
  `uid` bigint NOT NULL default '0',
 
3293
  `totalmods` bigint NOT NULL default '0',
 
3294
  `realname` varchar(50) default NULL,
 
3295
  `bio` text NOT NULL,
 
3296
  `tokens` bigint NOT NULL default '0',
 
3297
  `lastgranted` datetime NOT NULL,
 
3298
  `m2info` varchar(64) NOT NULL default '',
 
3299
  `karma` bigint NOT NULL default '0',
 
3300
  `maillist` int NOT NULL default '0',
 
3301
  `totalcomments` bigint default '0',
 
3302
  `lastm2` datetime NOT NULL default '1970-01-01 00:00:00',
 
3303
  `m2_mods_saved` varchar(120) NOT NULL default '',
 
3304
  `lastaccess` date NOT NULL,
 
3305
  `m2fair` bigint NOT NULL default '0',
 
3306
  `up_fair` bigint NOT NULL default '0',
 
3307
  `down_fair` bigint NOT NULL default '0',
 
3308
  `m2unfair` bigint NOT NULL default '0',
 
3309
  `up_unfair` bigint NOT NULL default '0',
 
3310
  `down_unfair` bigint NOT NULL default '0',
 
3311
  `m2fairvotes` bigint NOT NULL default '0',
 
3312
  `m2voted_up_fair` bigint NOT NULL default '0',
 
3313
  `m2voted_down_fair` bigint NOT NULL default '0',
 
3314
  `m2unfairvotes` bigint NOT NULL default '0',
 
3315
  `m2voted_up_unfair` bigint NOT NULL default '0',
 
3316
  `m2voted_down_unfair` bigint NOT NULL default '0',
 
3317
  `m2voted_lonedissent` bigint NOT NULL default '0',
 
3318
  `m2voted_majority` bigint NOT NULL default '0',
 
3319
  `upmods` bigint NOT NULL default '0',
 
3320
  `downmods` bigint NOT NULL default '0',
 
3321
  `stirred` bigint NOT NULL default '0',
 
3322
  `session_login` int NOT NULL default '0',
 
3323
  `cookie_location` enum('classbid','subnetid','ipid','none') NOT NULL default 'none',
 
3324
  `created_at` datetime NOT NULL,
 
3325
  `tag_clout` float NOT NULL default '1',
 
3326
  `registered` int NOT NULL default '1',
 
3327
  `reg_id` varchar(32) NOT NULL default '',
 
3328
  `expiry_days` int NOT NULL default '1',
 
3329
  `expiry_comm` int NOT NULL default '1',
 
3330
  `user_expiry_days` int NOT NULL default '1',
 
3331
  `user_expiry_comm` int NOT NULL default '1',
 
3332
  `initdomain` varchar(30) NOT NULL default '',
 
3333
  `created_ipid` varchar(32) NOT NULL default '',
 
3334
  `people` blob,
 
3335
  `people_status` enum('ok','dirty') NOT NULL default 'ok',
 
3336
  `csq_bonuses` float NOT NULL default '0',
 
3337
  PRIMARY KEY  (`uid`),
 
3338
  KEY `people_status` (`people_status`),
 
3339
  KEY `initdomain` (`initdomain`),
 
3340
  KEY `created_ipid` (`created_ipid`),
 
3341
  KEY `tokens` (`tokens`)
 
3342
);
 
3343
 
 
3344
--
 
3345
-- Table structure for table `users_logtokens`
 
3346
--
 
3347
 
 
3348
DROP TABLE IF EXISTS `users_logtokens`;
 
3349
CREATE TABLE `users_logtokens` (
 
3350
  `lid` bigint NOT NULL auto_increment,
 
3351
  `uid` bigint NOT NULL default '0',
 
3352
  `locationid` varchar(32) NOT NULL default '',
 
3353
  `temp` enum('yes','no') NOT NULL default 'no',
 
3354
  `public` enum('yes','no') NOT NULL default 'no',
 
3355
  `expires` datetime NOT NULL default '2000-01-01 00:00:00',
 
3356
  `value` varchar(22) NOT NULL default '',
 
3357
  PRIMARY KEY  (`lid`),
 
3358
  UNIQUE KEY `uid_locationid_temp_public` (`uid`,`locationid`,`temp`,`public`),
 
3359
  KEY `locationid` (`locationid`),
 
3360
  KEY `temp` (`temp`),
 
3361
  KEY `public` (`public`)
 
3362
);
 
3363
 
 
3364
--
 
3365
-- Table structure for table `users_messages`
 
3366
--
 
3367
 
 
3368
DROP TABLE IF EXISTS `users_messages`;
 
3369
CREATE TABLE `users_messages` (
 
3370
  `id` int NOT NULL auto_increment,
 
3371
  `uid` bigint NOT NULL default '0',
 
3372
  `code` int NOT NULL default '0',
 
3373
  `mode` int NOT NULL default '0',
 
3374
  PRIMARY KEY  (`id`),
 
3375
  UNIQUE KEY `code_key` (`uid`,`code`)
 
3376
);
 
3377
 
 
3378
--
 
3379
-- Table structure for table `users_openid`
 
3380
--
 
3381
 
 
3382
DROP TABLE IF EXISTS `users_openid`;
 
3383
CREATE TABLE `users_openid` (
 
3384
  `opid` int NOT NULL auto_increment,
 
3385
  `openid_url` varchar(255) NOT NULL,
 
3386
  `uid` bigint NOT NULL,
 
3387
  PRIMARY KEY  (`opid`),
 
3388
  UNIQUE KEY `openid_url` (`openid_url`),
 
3389
  KEY `uid` (`uid`)
 
3390
);
 
3391
 
 
3392
--
 
3393
-- Table structure for table `users_openid_reskeys`
 
3394
--
 
3395
 
 
3396
DROP TABLE IF EXISTS `users_openid_reskeys`;
 
3397
CREATE TABLE `users_openid_reskeys` (
 
3398
  `oprid` int NOT NULL auto_increment,
 
3399
  `openid_url` varchar(255) NOT NULL,
 
3400
  `reskey` varchar(20) NOT NULL default '',
 
3401
  PRIMARY KEY  (`oprid`),
 
3402
  KEY `openid_url` (`openid_url`),
 
3403
  KEY `reskey` (`reskey`)
 
3404
);
 
3405
 
 
3406
--
 
3407
-- Table structure for table `users_param`
 
3408
--
 
3409
 
 
3410
DROP TABLE IF EXISTS `users_param`;
 
3411
CREATE TABLE `users_param` (
 
3412
  `param_id` int NOT NULL auto_increment,
 
3413
  `uid` bigint NOT NULL,
 
3414
  `name` varchar(32) NOT NULL default '',
 
3415
  `value` text NOT NULL,
 
3416
  PRIMARY KEY  (`param_id`),
 
3417
  UNIQUE KEY `uid_key` (`uid`,`name`),
 
3418
  KEY `name` (`name`)
 
3419
);
 
3420
 
 
3421
--
 
3422
-- Table structure for table `users_prefs`
 
3423
--
 
3424
 
 
3425
DROP TABLE IF EXISTS `users_prefs`;
 
3426
CREATE TABLE `users_prefs` (
 
3427
  `uid` bigint NOT NULL default '0',
 
3428
  `willing` int NOT NULL default '1',
 
3429
  `dfid` int NOT NULL default '0',
 
3430
  `tzcode` varchar(4) NOT NULL default 'EST',
 
3431
  `noicons` int NOT NULL default '0',
 
3432
  `light` int NOT NULL default '0',
 
3433
  `mylinks` varchar(255) NOT NULL default '',
 
3434
  `lang` varchar(5) NOT NULL default 'en_US',
 
3435
  PRIMARY KEY  (`uid`)
 
3436
);
 
3437
 
 
3438
--
 
3439
-- Table structure for table `vars`
 
3440
--
 
3441
 
 
3442
DROP TABLE IF EXISTS `vars`;
 
3443
CREATE TABLE `vars` (
 
3444
  `name` varchar(48) NOT NULL default '',
 
3445
  `value` text,
 
3446
  `description` varchar(255) default NULL,
 
3447
  PRIMARY KEY  (`name`)
 
3448
);
 
3449
 
 
3450
--
 
3451
-- Table structure for table `wow_char_armorylog`
 
3452
--
 
3453
 
 
3454
DROP TABLE IF EXISTS `wow_char_armorylog`;
 
3455
CREATE TABLE `wow_char_armorylog` (
 
3456
  `arlid` int NOT NULL auto_increment,
 
3457
  `charid` int NOT NULL,
 
3458
  `ts` datetime NOT NULL,
 
3459
  `armorydata` blob NOT NULL,
 
3460
  `raw_content` blob,
 
3461
  PRIMARY KEY  (`arlid`),
 
3462
  KEY `ts` (`ts`),
 
3463
  KEY `charid_ts` (`charid`,`ts`)
 
3464
);
 
3465
 
 
3466
--
 
3467
-- Table structure for table `wow_char_data`
 
3468
--
 
3469
 
 
3470
DROP TABLE IF EXISTS `wow_char_data`;
 
3471
CREATE TABLE `wow_char_data` (
 
3472
  `wcdid` int NOT NULL auto_increment,
 
3473
  `charid` int NOT NULL,
 
3474
  `wcdtype` int NOT NULL,
 
3475
  `value` varchar(100) default NULL,
 
3476
  PRIMARY KEY  (`wcdid`),
 
3477
  UNIQUE KEY `charid_wcdtype` (`charid`,`wcdtype`)
 
3478
);
 
3479
 
 
3480
--
 
3481
-- Table structure for table `wow_char_types`
 
3482
--
 
3483
 
 
3484
DROP TABLE IF EXISTS `wow_char_types`;
 
3485
CREATE TABLE `wow_char_types` (
 
3486
  `wcdtype` int NOT NULL auto_increment,
 
3487
  `name` varchar(100) NOT NULL,
 
3488
  PRIMARY KEY  (`wcdtype`),
 
3489
  UNIQUE KEY `name` (`name`)
 
3490
);
 
3491
 
 
3492
--
 
3493
-- Table structure for table `wow_chars`
 
3494
--
 
3495
 
 
3496
DROP TABLE IF EXISTS `wow_chars`;
 
3497
CREATE TABLE `wow_chars` (
 
3498
  `charid` int NOT NULL auto_increment,
 
3499
  `realmid` int NOT NULL,
 
3500
  `charname` varchar(12) NOT NULL,
 
3501
  `guildid` int default NULL,
 
3502
  `uid` bigint default NULL,
 
3503
  `last_retrieval_attempt` datetime default NULL,
 
3504
  `last_retrieval_success` datetime default NULL,
 
3505
  PRIMARY KEY  (`charid`),
 
3506
  UNIQUE KEY `realm_name` (`realmid`,`charname`),
 
3507
  KEY `name` (`charname`),
 
3508
  KEY `uid` (`uid`),
 
3509
  KEY `last_retrieval_success` (`last_retrieval_success`),
 
3510
  KEY `last_retrieval_attempt` (`last_retrieval_attempt`)
 
3511
);
 
3512
 
 
3513
--
 
3514
-- Table structure for table `wow_guilds`
 
3515
--
 
3516
 
 
3517
DROP TABLE IF EXISTS `wow_guilds`;
 
3518
CREATE TABLE `wow_guilds` (
 
3519
  `guildid` int NOT NULL auto_increment,
 
3520
  `realmid` int NOT NULL,
 
3521
  `guildname` varchar(64) NOT NULL,
 
3522
  PRIMARY KEY  (`guildid`),
 
3523
  UNIQUE KEY `idx_name` (`realmid`,`guildname`)
 
3524
);
 
3525
 
 
3526
--
 
3527
-- Table structure for table `wow_realms`
 
3528
--
 
3529
 
 
3530
DROP TABLE IF EXISTS `wow_realms`;
 
3531
CREATE TABLE `wow_realms` (
 
3532
  `realmid` int NOT NULL auto_increment,
 
3533
  `countryname` varchar(2) NOT NULL,
 
3534
  `realmname` varchar(64) NOT NULL,
 
3535
  `type` enum('pve','pvp','rp','rppvp') NOT NULL default 'pve',
 
3536
  `battlegroup` varchar(16) default NULL,
 
3537
  PRIMARY KEY  (`realmid`),
 
3538
  UNIQUE KEY `country_realm` (`countryname`,`realmname`),
 
3539
  KEY `battlegroup` (`countryname`,`battlegroup`)
 
3540
);
 
3541
 
 
3542
--
 
3543
-- Table structure for table `xsite_auth_log`
 
3544
--
 
3545
 
 
3546
DROP TABLE IF EXISTS `xsite_auth_log`;
 
3547
CREATE TABLE `xsite_auth_log` (
 
3548
  `site` varchar(30) NOT NULL default '',
 
3549
  `ts` datetime NOT NULL,
 
3550
  `nonce` varchar(30) NOT NULL default '',
 
3551
  UNIQUE KEY `site` (`site`,`ts`,`nonce`)
 
3552
);