forked from zigdon/xkcd-Bucket
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bucket.sql
133 lines (109 loc) · 3.46 KB
/
bucket.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
-- phpMyAdmin SQL Dump
-- version 2.11.6
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: May 22, 2009 at 12:36 PM
-- Server version: 5.0.51
-- PHP Version: 5.2.6-3
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
--
-- Database: `xkcd`
--
-- --------------------------------------------------------
--
-- Table structure for table `bucket_facts`
--
CREATE TABLE IF NOT EXISTS `bucket_facts` (
`id` int(10) unsigned NOT NULL auto_increment,
`fact` varchar(128) NOT NULL,
`tidbit` text NOT NULL,
`verb` varchar(16) NOT NULL default 'is',
`RE` tinyint(1) NOT NULL,
`protected` tinyint(1) NOT NULL,
`mood` tinyint(3) unsigned default NULL,
`chance` tinyint(3) unsigned default NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `fact` (`fact`,`tidbit`(200),`verb`),
KEY `trigger` (`fact`),
KEY `RE` (`RE`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `bucket_items`
--
CREATE TABLE IF NOT EXISTS `bucket_items` (
`id` int(10) unsigned NOT NULL auto_increment,
`channel` varchar(64) NOT NULL,
`what` varchar(255) NOT NULL,
`user` varchar(64) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `what` (`what`),
KEY `from` (`user`),
KEY `where` (`channel`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;
-- --------------------------------------------------------
--
-- Table structure for table `mainlog`
--
CREATE TABLE IF NOT EXISTS `mainlog` (
`id` int(10) unsigned NOT NULL auto_increment,
`stamp` timestamp NOT NULL default CURRENT_TIMESTAMP,
`msg` varchar(512) NOT NULL,
PRIMARY KEY (`id`),
KEY `stamp` (`stamp`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `bucket_values`
--
CREATE TABLE IF NOT EXISTS `bucket_values` (
`id` int(10) unsigned NOT NULL auto_increment,
`var_id` int(10) unsigned NOT NULL,
`value` varchar(32) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `var_id` (`var_id`,`value`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `bucket_vars`
--
CREATE TABLE IF NOT EXISTS `bucket_vars` (
`id` int(10) unsigned NOT NULL auto_increment,
`name` varchar(16) NOT NULL,
`perms` enum('read-only','editable') NOT NULL default 'read-only',
`type` enum('var','verb','noun') NOT NULL default 'var',
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Table structure for table `genders`
--
CREATE TABLE IF NOT EXISTS `genders` (
`id` int(10) unsigned NOT NULL auto_increment,
`nick` varchar(30) NOT NULL,
`gender` enum('male','female','Androgynous','inanimate','full name') NOT NULL default 'Androgynous',
`stamp` timestamp NOT NULL default CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `nick` (`nick`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Table structure for table `word2id`
--
DROP TABLE IF EXISTS `word2id`;
CREATE TABLE IF NOT EXISTS `word2id` (
`id` int(10) unsigned NOT NULL auto_increment,
`word` varchar(32) NOT NULL,
`lines` int(10) unsigned NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `word` (`word`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Table structure for table `word2line`
--
DROP TABLE IF EXISTS `word2line`;
CREATE TABLE IF NOT EXISTS `word2line` (
`word` int(10) unsigned NOT NULL,
`line` int(10) unsigned NOT NULL,
KEY `word` (`word`,`line`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;