3 -- http://www.phpmyadmin.net
6 -- Generation Time: Mar 22, 2006 at 09:39 PM
7 -- Server version: 5.0.19
8 -- PHP Version: 5.1.2-gentoo
14 -- Database: `so2-dev`
17 -- --------------------------------------------------------
20 -- Table structure for table `board-groups`
23 CREATE TABLE `board-groups` (
24 `groupid` tinyint(3) unsigned NOT NULL auto_increment,
25 `group_name` varchar(50) character set latin1 NOT NULL,
26 PRIMARY KEY (`groupid`)
27 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
29 -- --------------------------------------------------------
32 -- Table structure for table `boards`
35 CREATE TABLE `boards` (
36 `boardid` tinyint(4) NOT NULL auto_increment,
37 `groupid` tinyint(3) unsigned NOT NULL default '0',
38 `board_name` varchar(255) NOT NULL,
39 `caption` varchar(255) NOT NULL,
40 `post_restrict` enum('none','admin-topics','admin') NOT NULL default 'none',
41 `view_restrict` enum('none','authuser','admin') NOT NULL default 'none',
42 PRIMARY KEY (`boardid`),
43 KEY `groupid` (`groupid`)
44 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
46 -- --------------------------------------------------------
49 -- Table structure for table `marks`
52 CREATE TABLE `marks` (
53 `messageid` mediumint(8) unsigned NOT NULL default '0',
54 `userid` smallint(5) unsigned NOT NULL,
55 `change` tinyint(4) NOT NULL,
56 `time` int(10) unsigned NOT NULL,
57 PRIMARY KEY (`messageid`,`userid`)
58 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
60 -- --------------------------------------------------------
63 -- Table structure for table `message-data`
66 CREATE TABLE `message-data` (
67 `messageid` mediumint(8) unsigned NOT NULL default '0',
68 `mtext` text NOT NULL,
69 PRIMARY KEY (`messageid`)
70 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
72 -- --------------------------------------------------------
75 -- Table structure for table `messages`
78 CREATE TABLE `messages` (
79 `messageid` mediumint(8) unsigned NOT NULL auto_increment,
80 `topicid` mediumint(8) unsigned NOT NULL default '0',
81 `userid` smallint(5) unsigned NOT NULL default '0',
82 `mtime` int(10) unsigned NOT NULL,
83 `score` smallint(6) NOT NULL default '0',
84 `marks` smallint(5) unsigned NOT NULL default '0',
85 `replyto` mediumint(8) unsigned default NULL,
86 `origin_ip` int(10) unsigned NOT NULL,
87 PRIMARY KEY (`messageid`),
88 KEY `topicid` (`topicid`),
89 KEY `userid` (`userid`),
90 KEY `replyto` (`replyto`)
91 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
93 -- --------------------------------------------------------
96 -- Table structure for table `themes`
99 CREATE TABLE `themes` (
100 `themeid` tinyint(3) unsigned NOT NULL auto_increment,
101 `theme_name` char(20) NOT NULL,
102 `css_file` char(20) NOT NULL,
103 PRIMARY KEY (`themeid`)
104 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 PACK_KEYS=0 ROW_FORMAT=FIXED;
106 -- --------------------------------------------------------
109 -- Table structure for table `things`
112 CREATE TABLE `things` (
113 `id` smallint(5) unsigned NOT NULL auto_increment,
114 `userid` smallint(5) unsigned NOT NULL,
115 `what` enum('invite','admin') NOT NULL,
116 `data` varchar(36) default NULL,
118 KEY `userid` (`userid`),
120 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
122 -- --------------------------------------------------------
125 -- Table structure for table `topics`
128 CREATE TABLE `topics` (
129 `topicid` mediumint(8) unsigned NOT NULL auto_increment,
130 `topic_title` varchar(255) NOT NULL,
131 `userid` smallint(5) unsigned NOT NULL default '0',
132 `boardid` tinyint(4) NOT NULL default '0',
133 `visibility` enum('normal','sticky','deleted') NOT NULL default 'normal',
134 `closed` tinyint(1) NOT NULL default '0',
135 `lastpost` mediumint(8) unsigned default NULL,
136 PRIMARY KEY (`topicid`),
137 KEY `lastpost` (`lastpost`),
138 KEY `boardid` (`boardid`),
139 KEY `userid` (`userid`)
140 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
142 -- --------------------------------------------------------
145 -- Table structure for table `users`
148 CREATE TABLE `users` (
149 `userid` smallint(5) unsigned NOT NULL auto_increment,
150 `alias` varchar(25) NOT NULL,
152 `points` int(10) unsigned NOT NULL default '0',
153 `invites` tinyint(3) unsigned NOT NULL default '0',
154 `referrer` smallint(5) unsigned default NULL,
155 `options` set('namelinks','alwaysonline','javascript') NOT NULL default 'alwaysonline',
156 `boardlist_layout` tinyint(1) unsigned NOT NULL default '0',
157 `topiclist_layout` tinyint(1) unsigned NOT NULL default '0',
158 `msglist_layout` tinyint(1) unsigned NOT NULL default '0',
159 `msglist_style` tinyint(1) unsigned NOT NULL default '0',
160 `topics_page` tinyint(3) unsigned NOT NULL default '35',
161 `msgs_page` tinyint(3) unsigned NOT NULL default '35',
162 `timezone` tinyint(2) NOT NULL default '0',
163 `theme` tinyint(3) unsigned NOT NULL default '4',
164 `last_active_date` int(10) unsigned NOT NULL,
165 `register_date` int(10) unsigned NOT NULL,
166 `sig` varchar(255) default NULL,
167 `quote` varchar(255) default NULL,
168 `useragent` varchar(160) default NULL,
169 `public_email` varchar(70) default NULL,
170 `private_email` varchar(70) default NULL,
171 `reg_email` varchar(70) NOT NULL,
172 `last_ip` int(10) unsigned default '0',
173 `last_login_ip` int(10) unsigned default '0',
174 `reg_ip` int(10) unsigned default '0',
175 `date_format` varchar(40) NOT NULL default 'Y-m-d H:i:s',
176 `comment_threshold` tinyint(1) NOT NULL default '0',
177 PRIMARY KEY (`userid`),
178 KEY `u_referrer` (`referrer`),
179 KEY `alias` (`alias`),
180 KEY `last_active_date` (`last_active_date`)
181 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
184 -- Constraints for dumped tables
188 -- Constraints for table `message-data`
190 ALTER TABLE `message-data`
191 ADD CONSTRAINT `message-data_ibfk_1` FOREIGN KEY (`messageid`) REFERENCES `messages` (`messageid`) ON DELETE CASCADE;
194 -- Constraints for table `messages`
196 ALTER TABLE `messages`
197 ADD CONSTRAINT `messages_ibfk_7` FOREIGN KEY (`topicid`) REFERENCES `topics` (`topicid`) ON DELETE CASCADE,
198 ADD CONSTRAINT `messages_ibfk_8` FOREIGN KEY (`userid`) REFERENCES `users` (`userid`) ON DELETE CASCADE,
199 ADD CONSTRAINT `messages_ibfk_9` FOREIGN KEY (`replyto`) REFERENCES `messages` (`messageid`) ON DELETE CASCADE;
202 -- Constraints for table `things`
205 ADD CONSTRAINT `things_ibfk_1` FOREIGN KEY (`userid`) REFERENCES `users` (`userid`) ON DELETE CASCADE;
208 -- Constraints for table `topics`
211 ADD CONSTRAINT `topics_ibfk_1` FOREIGN KEY (`userid`) REFERENCES `users` (`userid`) ON DELETE CASCADE,
212 ADD CONSTRAINT `topics_ibfk_2` FOREIGN KEY (`lastpost`) REFERENCES `messages` (`messageid`) ON DELETE CASCADE;
215 -- Constraints for table `users`
218 ADD CONSTRAINT `users_ibfk_1` FOREIGN KEY (`referrer`) REFERENCES `users` (`userid`) ON DELETE CASCADE;