Change stuff a bit, and make the contact things in the user table bigger
[specialops2.git] / res / structure.sql
blob19874ba4d37828ceb80384fda587ed25c4716810
1 -- phpMyAdmin SQL Dump
2 -- version 2.8.0.2
3 -- http://www.phpmyadmin.net
4 -- 
5 -- Host: localhost
6 -- Generation Time: Apr 01, 2006 at 05:01 PM
7 -- Server version: 5.0.19
8 -- PHP Version: 5.1.2-gentoo
9 -- 
10 -- Database: `so2-dev`
11 -- 
13 -- --------------------------------------------------------
15 -- 
16 -- Table structure for table `board-groups`
17 -- 
19 CREATE TABLE `board-groups` (
20   `groupid` tinyint(3) unsigned NOT NULL auto_increment,
21   `group_name` varchar(50) character set latin1 NOT NULL,
22   PRIMARY KEY  (`groupid`)
23 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
25 -- --------------------------------------------------------
27 -- 
28 -- Table structure for table `boards`
29 -- 
31 CREATE TABLE `boards` (
32   `boardid` tinyint(4) NOT NULL auto_increment,
33   `groupid` tinyint(3) unsigned NOT NULL default '0',
34   `board_name` varchar(255) NOT NULL,
35   `caption` varchar(255) NOT NULL,
36   `post_restrict` enum('none','admin-topics','admin') NOT NULL default 'none',
37   `view_restrict` enum('none','authuser','admin') NOT NULL default 'none',
38   PRIMARY KEY  (`boardid`),
39   KEY `groupid` (`groupid`)
40 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
42 -- --------------------------------------------------------
44 -- 
45 -- Table structure for table `marks`
46 -- 
48 CREATE TABLE `marks` (
49   `messageid` mediumint(8) unsigned NOT NULL default '0',
50   `userid` smallint(5) unsigned NOT NULL,
51   `change` tinyint(4) NOT NULL,
52   `time` int(10) unsigned NOT NULL,
53   PRIMARY KEY  (`messageid`,`userid`)
54 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
56 -- --------------------------------------------------------
58 -- 
59 -- Table structure for table `message-data`
60 -- 
62 CREATE TABLE `message-data` (
63   `messageid` mediumint(8) unsigned NOT NULL default '0',
64   `mtext` text NOT NULL,
65   PRIMARY KEY  (`messageid`)
66 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
68 -- --------------------------------------------------------
70 -- 
71 -- Table structure for table `messages`
72 -- 
74 CREATE TABLE `messages` (
75   `messageid` mediumint(8) unsigned NOT NULL auto_increment,
76   `topicid` mediumint(8) unsigned NOT NULL default '0',
77   `userid` smallint(5) unsigned NOT NULL default '0',
78   `mtime` int(10) unsigned NOT NULL,
79   `score` smallint(6) NOT NULL default '0',
80   `marks` smallint(5) unsigned NOT NULL default '0',
81   `replyto` mediumint(8) unsigned default NULL,
82   `origin_ip` int(10) unsigned NOT NULL,
83   PRIMARY KEY  (`messageid`),
84   KEY `topicid` (`topicid`),
85   KEY `userid` (`userid`),
86   KEY `replyto` (`replyto`)
87 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
89 -- --------------------------------------------------------
91 -- 
92 -- Table structure for table `themes`
93 -- 
95 CREATE TABLE `themes` (
96   `themeid` tinyint(3) unsigned NOT NULL auto_increment,
97   `theme_name` char(20) NOT NULL,
98   `css_file` char(20) NOT NULL,
99   PRIMARY KEY  (`themeid`)
100 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 PACK_KEYS=0 ROW_FORMAT=FIXED;
102 -- --------------------------------------------------------
104 -- 
105 -- Table structure for table `things`
106 -- 
108 CREATE TABLE `things` (
109   `id` smallint(5) unsigned NOT NULL auto_increment,
110   `userid` smallint(5) unsigned NOT NULL,
111   `what` enum('invite','admin') NOT NULL,
112   `data` varchar(36) default NULL,
113   PRIMARY KEY  (`id`),
114   KEY `userid` (`userid`),
115   KEY `item` (`what`)
116 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
118 -- --------------------------------------------------------
120 -- 
121 -- Table structure for table `topics`
122 -- 
124 CREATE TABLE `topics` (
125   `topicid` mediumint(8) unsigned NOT NULL auto_increment,
126   `topic_title` varchar(255) NOT NULL,
127   `userid` smallint(5) unsigned NOT NULL default '0',
128   `boardid` tinyint(4) NOT NULL default '0',
129   `visibility` enum('normal','sticky','deleted') NOT NULL default 'normal',
130   `closed` tinyint(1) NOT NULL default '0',
131   `lastpost` mediumint(8) unsigned default NULL,
132   PRIMARY KEY  (`topicid`),
133   KEY `lastpost` (`lastpost`),
134   KEY `boardid` (`boardid`),
135   KEY `userid` (`userid`)
136 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
138 -- --------------------------------------------------------
140 -- 
141 -- Table structure for table `users`
142 -- 
144 CREATE TABLE `users` (
145   `userid` smallint(5) unsigned NOT NULL auto_increment,
146   `alias` varchar(25) NOT NULL,
147   `password` tinyblob,
148   `points` int(10) unsigned NOT NULL default '0',
149   `invites` tinyint(3) unsigned NOT NULL default '0',
150   `referrer` smallint(5) unsigned default NULL,
151   `options` set('namelinks','alwaysonline','javascript') NOT NULL default 'alwaysonline',
152   `boardlist_layout` tinyint(1) unsigned NOT NULL default '0',
153   `topiclist_layout` tinyint(1) unsigned NOT NULL default '0',
154   `msglist_layout` tinyint(1) unsigned NOT NULL default '0',
155   `msglist_style` tinyint(1) unsigned NOT NULL default '0',
156   `topics_page` tinyint(3) unsigned NOT NULL default '35',
157   `msgs_page` tinyint(3) unsigned NOT NULL default '35',
158   `timezone` tinyint(2) NOT NULL default '0',
159   `theme` tinyint(3) unsigned NOT NULL default '4',
160   `last_active_date` int(10) unsigned NOT NULL,
161   `register_date` int(10) unsigned NOT NULL,
162   `sig` varchar(255) default NULL,
163   `quote` varchar(255) default NULL,
164   `useragent` varchar(160) default NULL,
165   `public_contact` varchar(100) default NULL,
166   `private_contact` varchar(100) default NULL,
167   `reg_contact` varchar(100) NOT NULL,
168   `last_ip` int(10) unsigned default '0',
169   `last_login_ip` int(10) unsigned default '0',
170   `reg_ip` int(10) unsigned default '0',
171   `date_format` varchar(40) NOT NULL default 'Y-m-d H:i:s',
172   `comment_threshold` tinyint(1) NOT NULL default '0',
173   PRIMARY KEY  (`userid`),
174   KEY `u_referrer` (`referrer`),
175   KEY `alias` (`alias`),
176   KEY `last_active_date` (`last_active_date`)
177 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
179 -- 
180 -- Constraints for dumped tables
181 -- 
183 -- 
184 -- Constraints for table `message-data`
185 -- 
186 ALTER TABLE `message-data`
187   ADD CONSTRAINT `message-data_ibfk_1` FOREIGN KEY (`messageid`) REFERENCES `messages` (`messageid`) ON DELETE CASCADE;
189 -- 
190 -- Constraints for table `messages`
191 -- 
192 ALTER TABLE `messages`
193   ADD CONSTRAINT `messages_ibfk_7` FOREIGN KEY (`topicid`) REFERENCES `topics` (`topicid`) ON DELETE CASCADE,
194   ADD CONSTRAINT `messages_ibfk_8` FOREIGN KEY (`userid`) REFERENCES `users` (`userid`) ON DELETE CASCADE,
195   ADD CONSTRAINT `messages_ibfk_9` FOREIGN KEY (`replyto`) REFERENCES `messages` (`messageid`) ON DELETE CASCADE;
197 -- 
198 -- Constraints for table `things`
199 -- 
200 ALTER TABLE `things`
201   ADD CONSTRAINT `things_ibfk_1` FOREIGN KEY (`userid`) REFERENCES `users` (`userid`) ON DELETE CASCADE;
203 -- 
204 -- Constraints for table `topics`
205 -- 
206 ALTER TABLE `topics`
207   ADD CONSTRAINT `topics_ibfk_1` FOREIGN KEY (`userid`) REFERENCES `users` (`userid`) ON DELETE CASCADE,
208   ADD CONSTRAINT `topics_ibfk_2` FOREIGN KEY (`lastpost`) REFERENCES `messages` (`messageid`) ON DELETE CASCADE;
210 -- 
211 -- Constraints for table `users`
212 -- 
213 ALTER TABLE `users`
214   ADD CONSTRAINT `users_ibfk_1` FOREIGN KEY (`referrer`) REFERENCES `users` (`userid`) ON DELETE CASCADE;