3 -- http://www.phpmyadmin.net
6 -- Generation Time: May 18, 2006 at 04:34 PM
7 -- Server version: 5.0.21
8 -- PHP Version: 5.1.4-pl0-gentoo
10 SET FOREIGN_KEY_CHECKS=0;
16 -- Database: `so2-dev`
19 -- --------------------------------------------------------
22 -- Table structure for table `board-groups`
25 CREATE TABLE `board-groups` (
26 `groupid` tinyint(3) unsigned NOT NULL auto_increment,
27 `group_name` varchar(50) character set latin1 NOT NULL,
28 `hidden` tinyint(1) NOT NULL default '0',
29 PRIMARY KEY (`groupid`)
30 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
32 -- --------------------------------------------------------
35 -- Table structure for table `boards`
38 CREATE TABLE `boards` (
39 `boardid` smallint(6) NOT NULL auto_increment,
40 `groupid` tinyint(3) unsigned NOT NULL default '0',
41 `board_name` varchar(255) NOT NULL,
42 `caption` varchar(255) NOT NULL,
43 `post_restrict` enum('none','admin-topics','admin') NOT NULL default 'none',
44 `view_restrict` enum('none','authuser','admin') NOT NULL default 'none',
45 PRIMARY KEY (`boardid`),
46 KEY `groupid` (`groupid`)
47 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
49 -- --------------------------------------------------------
52 -- Table structure for table `marks`
55 CREATE TABLE `marks` (
56 `messageid` mediumint(8) unsigned NOT NULL default '0',
57 `userid` smallint(5) unsigned NOT NULL,
58 `change` tinyint(4) NOT NULL,
59 `time` int(10) unsigned NOT NULL,
60 PRIMARY KEY (`messageid`,`userid`)
61 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
63 -- --------------------------------------------------------
66 -- Table structure for table `message-data`
69 CREATE TABLE `message-data` (
70 `messageid` mediumint(8) unsigned NOT NULL default '0',
71 `mtext` text NOT NULL,
72 PRIMARY KEY (`messageid`)
73 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
75 -- --------------------------------------------------------
78 -- Table structure for table `messages`
81 CREATE TABLE `messages` (
82 `messageid` mediumint(8) unsigned NOT NULL auto_increment,
83 `topicid` mediumint(8) unsigned NOT NULL default '0',
84 `userid` smallint(5) unsigned NOT NULL default '0',
85 `mtime` int(10) unsigned NOT NULL,
86 `score` smallint(6) NOT NULL default '0',
87 `marks` smallint(5) unsigned NOT NULL default '0',
88 `replyto` mediumint(8) unsigned default NULL,
89 `origin_ip` int(10) unsigned NOT NULL,
90 PRIMARY KEY (`messageid`),
91 KEY `topicid` (`topicid`),
92 KEY `userid` (`userid`),
93 KEY `replyto` (`replyto`)
94 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
96 -- --------------------------------------------------------
99 -- Table structure for table `themes`
102 CREATE TABLE `themes` (
103 `themeid` tinyint(3) unsigned NOT NULL auto_increment,
104 `theme_name` char(20) NOT NULL,
105 `css_file` char(20) NOT NULL,
106 PRIMARY KEY (`themeid`)
107 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 PACK_KEYS=0 ROW_FORMAT=FIXED;
109 -- --------------------------------------------------------
112 -- Table structure for table `things`
115 CREATE TABLE `things` (
116 `id` smallint(5) unsigned NOT NULL auto_increment,
117 `userid` smallint(5) unsigned NOT NULL,
118 `what` enum('invite','admin') NOT NULL,
119 `data` varchar(36) default NULL,
121 KEY `userid` (`userid`),
123 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
125 -- --------------------------------------------------------
128 -- Table structure for table `topics`
131 CREATE TABLE `topics` (
132 `topicid` mediumint(8) unsigned NOT NULL auto_increment,
133 `topic_title` varchar(255) NOT NULL,
134 `userid` smallint(5) unsigned NOT NULL default '0',
135 `boardid` smallint(6) NOT NULL default '0',
136 `visibility` enum('normal','sticky','deleted') NOT NULL default 'normal',
137 `closed` tinyint(1) NOT NULL default '0',
138 `lastpost` mediumint(8) unsigned default NULL,
139 PRIMARY KEY (`topicid`),
140 KEY `lastpost` (`lastpost`),
141 KEY `boardid` (`boardid`),
142 KEY `userid` (`userid`)
143 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
145 -- --------------------------------------------------------
148 -- Table structure for table `users`
151 CREATE TABLE `users` (
152 `userid` smallint(5) unsigned NOT NULL auto_increment,
153 `alias` varchar(25) NOT NULL,
155 `points` int(11) NOT NULL default '0',
156 `invites` tinyint(3) unsigned NOT NULL default '0',
157 `referrer` smallint(5) unsigned default NULL,
158 `options` set('namelinks','translucent','javascript','cache','quickpost') NOT NULL default '',
159 `boardlist_layout` tinyint(1) unsigned NOT NULL default '0',
160 `topiclist_layout` tinyint(1) unsigned NOT NULL default '0',
161 `msglist_layout` tinyint(1) unsigned NOT NULL default '0',
162 `msglist_style` tinyint(1) unsigned NOT NULL default '0',
163 `topics_page` tinyint(3) unsigned NOT NULL default '35',
164 `msgs_page` tinyint(3) unsigned NOT NULL default '35',
165 `timezone` tinyint(2) NOT NULL default '0',
166 `theme` tinyint(3) unsigned NOT NULL default '4',
167 `last_active_date` int(10) unsigned NOT NULL,
168 `register_date` int(10) unsigned NOT NULL,
169 `sig` varchar(255) default NULL,
170 `quote` varchar(255) default NULL,
171 `useragent` varchar(160) default NULL,
172 `public_contact` varchar(100) default NULL,
173 `private_contact` varchar(100) default NULL,
174 `reg_contact` varchar(100) NOT NULL,
175 `last_ip` int(10) unsigned default '0',
176 `last_login_ip` int(10) unsigned default '0',
177 `reg_ip` int(10) unsigned default '0',
178 `date_format` varchar(40) NOT NULL default 'Y-m-d H:i:s',
179 PRIMARY KEY (`userid`),
180 KEY `u_referrer` (`referrer`),
181 KEY `alias` (`alias`),
182 KEY `last_active_date` (`last_active_date`)
183 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
186 -- Constraints for dumped tables
190 -- Constraints for table `message-data`
192 ALTER TABLE `message-data`
193 ADD CONSTRAINT `message-data_ibfk_1` FOREIGN KEY (`messageid`) REFERENCES `messages` (`messageid`) ON DELETE CASCADE;
196 -- Constraints for table `messages`
198 ALTER TABLE `messages`
199 ADD CONSTRAINT `messages_ibfk_7` FOREIGN KEY (`topicid`) REFERENCES `topics` (`topicid`) ON DELETE CASCADE,
200 ADD CONSTRAINT `messages_ibfk_8` FOREIGN KEY (`userid`) REFERENCES `users` (`userid`) ON DELETE CASCADE,
201 ADD CONSTRAINT `messages_ibfk_9` FOREIGN KEY (`replyto`) REFERENCES `messages` (`messageid`) ON DELETE CASCADE;
204 -- Constraints for table `things`
207 ADD CONSTRAINT `things_ibfk_1` FOREIGN KEY (`userid`) REFERENCES `users` (`userid`) ON DELETE CASCADE;
210 -- Constraints for table `topics`
213 ADD CONSTRAINT `topics_ibfk_1` FOREIGN KEY (`userid`) REFERENCES `users` (`userid`) ON DELETE CASCADE,
214 ADD CONSTRAINT `topics_ibfk_2` FOREIGN KEY (`lastpost`) REFERENCES `messages` (`messageid`) ON DELETE CASCADE;
217 -- Constraints for table `users`
220 ADD CONSTRAINT `users_ibfk_1` FOREIGN KEY (`referrer`) REFERENCES `users` (`userid`) ON DELETE CASCADE;
222 SET FOREIGN_KEY_CHECKS=1;