Vanilla commit.
[tinybbs.git] / INSTALL.sql
blob853ad11f5683fb703aa247be4c29922fe81afa4e
1 -- Import this SQL file to install ATBBS.
3 SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
6 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
7 /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
8 /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
9 /*!40101 SET NAMES utf8 */;
12 -- Create tables:
14 -- --------------------------------------------------------
17 -- Table structure for table `activity`
20 CREATE TABLE `activity` (
21   `uid` varchar(23) NOT NULL,
22   `time` int(10) NOT NULL,
23   `action_name` varchar(60) NOT NULL,
24   `action_id` int(10) NOT NULL,
25   PRIMARY KEY  (`uid`),
26   KEY `time` (`time`)
27 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
29 -- --------------------------------------------------------
32 -- Table structure for table `failed_postings`
35 CREATE TABLE `failed_postings` (
36   `uid` varchar(23) NOT NULL,
37   `time` int(10) NOT NULL,
38   `reason` text NOT NULL,
39   `headline` varchar(100) NOT NULL,
40   `body` text NOT NULL,
41   KEY `time` (`time`)
42 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
44 -- --------------------------------------------------------
47 -- Table structure for table `ignore_lists`
50 CREATE TABLE `ignore_lists` (
51   `uid` varchar(23) NOT NULL,
52   `ignored_phrases` text NOT NULL,
53   PRIMARY KEY  (`uid`)
54 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
56 -- --------------------------------------------------------
59 -- Table structure for table `images`
62 CREATE TABLE IF NOT EXISTS `images` (
63   `file_name` varchar(80) NOT NULL,
64   `md5` varchar(32) NOT NULL,
65   `topic_id` int(10) unsigned DEFAULT NULL,
66   `reply_id` int(10) unsigned DEFAULT NULL,
67   UNIQUE KEY `reply_id` (`reply_id`),
68   UNIQUE KEY `topic_id` (`topic_id`)
69 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
71 -- --------------------------------------------------------
74 -- Table structure for table `ip_bans`
77 CREATE TABLE `ip_bans` (
78   `ip_address` varchar(100) NOT NULL,
79   `filed` int(10) NOT NULL,
80   `expiry` int(10) unsigned NOT NULL default '0',
81   PRIMARY KEY  (`ip_address`)
82 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
84 -- --------------------------------------------------------
87 -- Table structure for table `last_actions`
90 CREATE TABLE `last_actions` (
91   `feature` varchar(30) NOT NULL,
92   `time` int(11) NOT NULL,
93   PRIMARY KEY  (`feature`)
94 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
96 -- --------------------------------------------------------
99 -- Table structure for table `pages`
102 CREATE TABLE `pages` (
103   `id` int(6) unsigned NOT NULL auto_increment,
104   `url` varchar(100) NOT NULL,
105   `page_title` varchar(200) NOT NULL,
106   `content` text NOT NULL,
107   PRIMARY KEY  (`id`),
108   UNIQUE KEY `url` (`url`)
109 ) ENGINE=MyISAM  DEFAULT CHARSET=latin1;
111 -- --------------------------------------------------------
114 -- Table structure for table `replies`
117 CREATE TABLE `replies` (
118   `id` int(10) unsigned NOT NULL auto_increment,
119   `parent_id` int(10) NOT NULL,
120   `poster_number` int(10) NOT NULL,
121   `author` varchar(23) character set latin1 NOT NULL,
122   `author_ip` varchar(100) character set latin1 NOT NULL,
123   `time` int(10) NOT NULL,
124   `body` text character set latin1 NOT NULL,
125   `edit_time` int(10) default NULL,
126   `edit_mod` tinyint(1) default NULL,
127   PRIMARY KEY  (`id`),
128   KEY `parent_id` (`parent_id`,`author`,`author_ip`),
129   KEY `letter` (`poster_number`)
130 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8;
132 -- --------------------------------------------------------
135 -- Table structure for table `topics`
138 CREATE TABLE `topics` (
139   `id` int(11) unsigned NOT NULL auto_increment,
140   `time` int(10) unsigned NOT NULL,
141   `author` varchar(23) character set latin1 collate latin1_spanish_ci NOT NULL,
142   `author_ip` varchar(100) character set latin1 NOT NULL,
143   `replies` int(10) NOT NULL,
144   `last_post` int(10) NOT NULL,
145   `visits` int(10) NOT NULL default '0',
146   `headline` varchar(100) character set latin1 NOT NULL,
147   `body` text character set latin1 NOT NULL,
148   `edit_time` int(10) default NULL,
149   `edit_mod` tinyint(1) default NULL,
150   PRIMARY KEY  (`id`),
151   KEY `author` (`author`),
152   KEY `author_ip` (`author_ip`),
153   KEY `last_post` (`last_post`)
154 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8;
156 -- --------------------------------------------------------
159 -- Table structure for table `trash`
162 CREATE TABLE `trash` (
163   `uid` varchar(23) NOT NULL,
164   `time` int(10) NOT NULL,
165   `headline` varchar(100) NOT NULL,
166   `body` text NOT NULL,
167   KEY `uid` (`uid`)
168 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
170 -- --------------------------------------------------------
173 -- Table structure for table `uid_bans`
176 CREATE TABLE `uid_bans` (
177   `uid` varchar(23) NOT NULL,
178   `filed` int(10) NOT NULL,
179   PRIMARY KEY  (`uid`)
180 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
182 -- --------------------------------------------------------
185 -- Table structure for table `users`
188 CREATE TABLE `users` (
189   `uid` varchar(23) character set latin1 NOT NULL,
190   `password` varchar(32) character set latin1 NOT NULL,
191   `first_seen` int(10) NOT NULL,
192   `ip_address` varchar(100) character set latin1 NOT NULL,
193   PRIMARY KEY  (`uid`),
194   KEY `first_seen` (`first_seen`),
195   KEY `ip_address` (`ip_address`)
196 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
198 -- --------------------------------------------------------
201 -- Table structure for table `user_settings`
204 CREATE TABLE `user_settings` (
205   `uid` varchar(23) character set latin1 NOT NULL,
206   `memorable_name` varchar(100) character set latin1 NOT NULL,
207   `memorable_password` varchar(100) character set latin1 NOT NULL,
208   `email` varchar(100) character set latin1 NOT NULL,
209   `spoiler_mode` tinyint(1) NOT NULL default '0',
210   `snippet_length` smallint(3) NOT NULL default '80',
211   `topics_mode` tinyint(1) NOT NULL,
212   `ostrich_mode` tinyint(1) NOT NULL default '0',
213   PRIMARY KEY  (`uid`),
214   KEY `memorable_name` (`memorable_name`),
215   KEY `email` (`email`)
216 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
218 -- --------------------------------------------------------
221 -- Table structure for table `watchlists`
224 CREATE TABLE `watchlists` (
225   `uid` varchar(23) NOT NULL,
226   `topic_id` int(10) NOT NULL,
227   KEY `uid` (`uid`)
228 ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
230 -- --------------------------------------------------------
233 -- Insert some needed rows
235 INSERT INTO `last_actions` (`feature`, `time`) VALUES
236 ('last_bump', 0),
237 ('last_topic', 0);
239 INSERT INTO `pages` (`id`, `url`, `page_title`, `content`) VALUES
240 (1, 'FAQ', 'Frequently Asked Questions', '<h4>How do I edit the FAQ?</h4>\n<p>Use the <a href="/CMS">content manager</a>.</p>'),
241 (2, 'markup_syntax', 'Markup syntax', '<table>\r\n<thead>\r\n<tr>\r\n<th class="minimal">Output</th>\r\n<th>Input</th>\r\n</tr>\r\n</thead>\r\n<tbody>\r\n\r\n<tr class="odd">\r\n<td class="minimal"><em>Emphasis</em></td>\r\n<td><kbd>''''Emphasis''''</kbd></td>\r\n</tr>\r\n\r\n<tr>\r\n<td class="minimal"><strong>Strong emphasis</strong></td>\r\n<td><kbd>''''''Strong emphasis''''''</kbd></td>\r\n</tr>\r\n\r\n<tr class="odd">\r\n<td class="minimal"><h4 class="user">Header</h4></td>\r\n<td><kbd>==Header==</kbd></td>\r\n</tr>\r\n\r\n<tr>\r\n<td class="minimal"><span class="quote"><strong>></strong> Quote</span></td>\r\n<td><kbd>> Quote</kbd></td>\r\n</tr>\r\n\r\n\r\n<tr>\r\n<td class="minimal"><a href="http://example.com/">Link text</a></td>\r\n<td><kbd>[http://example.com/ Link text]</kbd></td>\r\n</tr>\r\n\r\n<tr>\r\n<td class="minimal"><span class="quote"><strong>></strong> Block</span><br /><span class="quote"><strong>></strong> quote</span></td>\r\n<td><kbd>[quote]Block<br />quote[/quote]</kbd></td>\r\n</tr>\r\n\r\n</tbody>\r\n</table>');