3 -- http://www.phpmyadmin.net
6 -- Generation Time: Mar 26, 2007 at 11:43 PM
7 -- Server version: 5.0.34
8 -- PHP Version: 5.2.1-pl3-gentoo
10 SET FOREIGN_KEY_CHECKS=0;
12 SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
21 -- --------------------------------------------------------
24 -- Table structure for table 'boards'
28 boardid smallint(6) NOT NULL auto_increment,
29 groupid tinyint(3) unsigned NOT NULL default '0',
30 board_name varchar(255) NOT NULL,
31 caption varchar(255) NOT NULL,
32 post_lvl enum('none','points','vip','admin') NOT NULL default 'none',
33 topic_lvl enum('none','points','vip','admin') NOT NULL default 'none',
34 view_lvl enum('none','login','points','vip','admin') NOT NULL default 'none',
35 points int(11) NOT NULL default '0',
36 posts int(10) unsigned NOT NULL default '0',
37 topics int(10) unsigned NOT NULL default '0',
38 PRIMARY KEY (boardid),
40 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
42 -- --------------------------------------------------------
45 -- Table structure for table 'board_groups'
48 CREATE TABLE board_groups (
49 groupid tinyint(3) unsigned NOT NULL auto_increment,
50 group_name varchar(50) character set latin1 NOT NULL,
51 hidden tinyint(1) NOT NULL default '0',
53 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
55 -- --------------------------------------------------------
58 -- Table structure for table 'marks'
62 messageid mediumint(8) unsigned NOT NULL default '0',
63 userid smallint(5) unsigned NOT NULL,
64 `change` tinyint(4) NOT NULL,
65 `time` int(10) unsigned NOT NULL,
66 PRIMARY KEY (messageid,userid)
67 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
69 -- --------------------------------------------------------
72 -- Table structure for table 'messages'
75 CREATE TABLE messages (
76 messageid int(10) unsigned NOT NULL auto_increment,
77 topicid int(10) unsigned NOT NULL default '0',
78 userid smallint(5) unsigned NOT NULL default '0',
79 mtime int(10) unsigned NOT NULL,
80 score smallint(6) NOT NULL default '0',
81 marks smallint(5) unsigned NOT NULL default '0',
82 replyto int(10) unsigned default NULL,
83 origin_ip int(10) unsigned NOT NULL,
84 PRIMARY KEY (messageid),
85 KEY topicid (topicid),
88 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
90 -- --------------------------------------------------------
93 -- Table structure for table 'themes'
97 themeid tinyint(3) unsigned NOT NULL auto_increment,
98 theme_name char(20) NOT NULL,
99 css_file char(20) NOT NULL,
100 PRIMARY KEY (themeid)
101 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 PACK_KEYS=0 ROW_FORMAT=FIXED;
103 -- --------------------------------------------------------
106 -- Table structure for table 'things'
109 CREATE TABLE things (
110 id smallint(5) unsigned NOT NULL auto_increment,
111 userid smallint(5) unsigned NOT NULL,
112 what enum('invite','admin') NOT NULL,
113 `data` varchar(36) default NULL,
117 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
119 -- --------------------------------------------------------
122 -- Table structure for table 'topics'
125 CREATE TABLE topics (
126 topicid int(10) unsigned NOT NULL auto_increment,
127 topic_title varchar(255) NOT NULL,
128 userid smallint(5) unsigned NOT NULL default '0',
129 boardid smallint(6) NOT NULL default '0',
130 visibility enum('normal','sticky','deleted') NOT NULL default 'normal',
131 closed tinyint(1) NOT NULL default '0',
132 lastpost int(10) unsigned default NULL,
133 posts int(10) unsigned NOT NULL default '0',
134 PRIMARY KEY (topicid),
135 KEY lastpost (lastpost),
136 KEY boardid (boardid),
138 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
140 -- --------------------------------------------------------
143 -- Table structure for table 'users'
147 userid smallint(5) unsigned NOT NULL auto_increment,
148 alias varchar(25) NOT NULL,
150 `level` enum('none','normal','vip','admin') NOT NULL default 'normal',
151 points int(10) NOT NULL default '0',
152 cutoff int(11) NOT NULL default '0',
153 invites tinyint(3) unsigned NOT NULL default '0',
154 referrer smallint(5) unsigned default NULL,
155 options set('alwaysonline','javascript','cache','quickpost') NOT NULL default 'alwaysonline',
156 boardlist_layout varchar(16) NOT NULL,
157 topiclist_layout varchar(16) NOT NULL,
158 msglist_layout varchar(16) NOT NULL,
159 msglist_style varchar(16) NOT NULL,
160 topics_page tinyint(3) unsigned NOT NULL default '35',
161 msgs_page tinyint(3) unsigned NOT NULL default '35',
162 post_html varchar(16) NOT NULL default 'Default',
163 tz varchar(24) NOT NULL default 'UTC',
164 theme_type enum('system','user') NOT NULL default 'system',
165 theme_id smallint(5) unsigned NOT NULL default '1',
166 custom_css tinyint(1) NOT NULL default '0',
167 last_passive_date int(10) unsigned NOT NULL,
168 last_active_date int(10) unsigned NOT NULL,
169 register_date int(10) unsigned NOT NULL,
170 sig varchar(255) default NULL,
171 quote varchar(255) default NULL,
172 useragent varchar(160) default NULL,
173 public_contact varchar(100) default NULL,
174 private_contact varchar(100) default NULL,
175 reg_contact varchar(100) NOT NULL,
176 last_ip int(10) unsigned default '0',
177 last_login_ip int(10) unsigned default '0',
178 reg_ip int(10) unsigned default '0',
179 date_format varchar(20) NOT NULL default 'Y-m-d H:i:s',
180 PRIMARY KEY (userid),
181 KEY u_referrer (referrer),
183 KEY last_active_date (last_active_date)
184 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
187 -- Constraints for dumped tables
191 -- Constraints for table `messages`
193 ALTER TABLE `messages`
194 ADD CONSTRAINT messages_ibfk_12 FOREIGN KEY (topicid) REFERENCES topics (topicid) ON DELETE CASCADE,
195 ADD CONSTRAINT messages_ibfk_13 FOREIGN KEY (userid) REFERENCES users (userid) ON DELETE CASCADE,
196 ADD CONSTRAINT messages_ibfk_14 FOREIGN KEY (replyto) REFERENCES messages (messageid) ON DELETE CASCADE;
199 -- Constraints for table `things`
202 ADD CONSTRAINT things_ibfk_1 FOREIGN KEY (userid) REFERENCES users (userid) ON DELETE CASCADE;
205 -- Constraints for table `topics`
208 ADD CONSTRAINT topics_ibfk_3 FOREIGN KEY (userid) REFERENCES users (userid) ON DELETE CASCADE,
209 ADD CONSTRAINT topics_ibfk_4 FOREIGN KEY (lastpost) REFERENCES messages (messageid) ON DELETE NO ACTION;
212 -- Constraints for table `users`
215 ADD CONSTRAINT users_ibfk_1 FOREIGN KEY (referrer) REFERENCES users (userid) ON DELETE CASCADE;
217 SET FOREIGN_KEY_CHECKS=1;