root/veekun/trunk/script/base.sql

Revision 422, 9.2 kB (checked in by eevee, 9 months ago)

Changed all MyISAM tables to InnoDB, and changed one last latin1 table to UTF-8. (#58)
Unbeknowst to me, InnoDB always sorts rows by primary key, so this diff is very large just from moving rows around. Sorry.

Line 
1/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
2/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
3/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
4/*!40101 SET NAMES utf8 */;
5/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
6/*!40103 SET TIME_ZONE='+00:00' */;
7/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
8/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
9/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
10/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
11
12--
13-- Table structure for table `edits`
14--
15
16DROP TABLE IF EXISTS edits;
17SET @saved_cs_client     = @@character_set_client;
18SET character_set_client = utf8;
19CREATE TABLE edits (
20  id int(10) unsigned NOT NULL auto_increment,
21  post_id int(10) unsigned NOT NULL default '0',
22  user_id int(10) unsigned NOT NULL default '0',
23  `time` int(10) unsigned NOT NULL default '0',
24  old_content mediumtext NOT NULL,
25  PRIMARY KEY  (id),
26  KEY POSTID USING BTREE (post_id)
27) ENGINE=InnoDB DEFAULT CHARSET=utf8;
28SET character_set_client = @saved_cs_client;
29
30--
31-- Table structure for table `error_log`
32--
33
34DROP TABLE IF EXISTS error_log;
35SET @saved_cs_client     = @@character_set_client;
36SET character_set_client = utf8;
37CREATE TABLE error_log (
38  id int(10) unsigned NOT NULL auto_increment,
39  `time` int(10) unsigned NOT NULL default '0',
40  user_id int(10) unsigned NOT NULL default '0',
41  ip int(10) unsigned NOT NULL default '0',
42  path tinytext NOT NULL,
43  method enum('POST','GET') default NULL,
44  `query` text NOT NULL,
45  error text NOT NULL,
46  PRIMARY KEY  (id)
47) ENGINE=InnoDB DEFAULT CHARSET=utf8;
48SET character_set_client = @saved_cs_client;
49
50--
51-- Table structure for table `forums`
52--
53
54DROP TABLE IF EXISTS forums;
55SET @saved_cs_client     = @@character_set_client;
56SET character_set_client = utf8;
57CREATE TABLE forums (
58  id int(10) unsigned NOT NULL auto_increment,
59  `name` varchar(80) NOT NULL default 'Untitled Forum',
60  last_post_id int(10) unsigned default NULL,
61  thread_count int(10) unsigned NOT NULL default '0',
62  post_count int(10) unsigned NOT NULL default '0',
63  flags set('header') NOT NULL,
64  accessibility enum('normal','locked','archive','hidden') NOT NULL default 'normal',
65  description varchar(255) NOT NULL,
66  PRIMARY KEY  (id)
67) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
68SET character_set_client = @saved_cs_client;
69
70--
71-- Table structure for table `group_permissions`
72--
73
74DROP TABLE IF EXISTS group_permissions;
75SET @saved_cs_client     = @@character_set_client;
76SET character_set_client = utf8;
77CREATE TABLE group_permissions (
78  group_id int(10) unsigned NOT NULL default '0',
79  permission varchar(64) NOT NULL default '',
80  scope varchar(64) NOT NULL default '',
81  polarity enum('allow','deny') default NULL,
82  PRIMARY KEY  USING BTREE (group_id,permission,scope)
83) ENGINE=InnoDB DEFAULT CHARSET=utf8;
84SET character_set_client = @saved_cs_client;
85
86--
87-- Table structure for table `groups`
88--
89
90DROP TABLE IF EXISTS groups;
91SET @saved_cs_client     = @@character_set_client;
92SET character_set_client = utf8;
93CREATE TABLE groups (
94  id int(10) unsigned NOT NULL auto_increment,
95  icon tinytext NOT NULL,
96  `name` tinytext NOT NULL,
97  UNIQUE KEY id (id)
98) ENGINE=InnoDB DEFAULT CHARSET=utf8;
99SET character_set_client = @saved_cs_client;
100
101--
102-- Table structure for table `messages`
103--
104
105DROP TABLE IF EXISTS messages;
106SET @saved_cs_client     = @@character_set_client;
107SET character_set_client = utf8;
108CREATE TABLE messages (
109  id int(10) unsigned NOT NULL auto_increment,
110  from_user_id int(10) unsigned NOT NULL default '0',
111  to_user_id int(10) unsigned NOT NULL default '0',
112  `time` int(10) unsigned NOT NULL default '0',
113  `subject` tinytext NOT NULL,
114  message mediumtext NOT NULL,
115  PRIMARY KEY  (id)
116) ENGINE=InnoDB DEFAULT CHARSET=utf8;
117SET character_set_client = @saved_cs_client;
118
119--
120-- Table structure for table `posts`
121--
122
123DROP TABLE IF EXISTS posts;
124SET @saved_cs_client     = @@character_set_client;
125SET character_set_client = utf8;
126CREATE TABLE posts (
127  id int(10) unsigned NOT NULL auto_increment,
128  thread_id int(10) unsigned NOT NULL default '0',
129  user_id int(10) unsigned NOT NULL default '0',
130  flags set('deleted') NOT NULL default '',
131  `time` int(10) unsigned NOT NULL default '0',
132  format enum('bbcode','raw','html') NOT NULL default 'raw',
133  content mediumtext NOT NULL,
134  last_edit_id int(10) unsigned NOT NULL default '0',
135  PRIMARY KEY  (id),
136  KEY THREAD USING BTREE (thread_id),
137  KEY `USER` USING BTREE (user_id)
138) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED;
139SET character_set_client = @saved_cs_client;
140
141--
142-- Table structure for table `sessions`
143--
144
145DROP TABLE IF EXISTS sessions;
146SET @saved_cs_client     = @@character_set_client;
147SET character_set_client = utf8;
148CREATE TABLE sessions (
149  id varchar(72) NOT NULL default '',
150  user_id int(10) unsigned NOT NULL default '0',
151  time_expires int(10) unsigned default NULL,
152  `data` mediumtext,
153  PRIMARY KEY  USING BTREE (id),
154  KEY USER_ID USING BTREE (user_id)
155) ENGINE=InnoDB DEFAULT CHARSET=utf8;
156SET character_set_client = @saved_cs_client;
157
158--
159-- Table structure for table `shoutbox`
160--
161
162DROP TABLE IF EXISTS shoutbox;
163SET @saved_cs_client     = @@character_set_client;
164SET character_set_client = utf8;
165CREATE TABLE shoutbox (
166  id int(10) unsigned NOT NULL auto_increment,
167  `name` varchar(24) NOT NULL default 'Anonymous',
168  user_id int(10) unsigned default NULL,
169  ip int(10) unsigned NOT NULL default '0',
170  `time` int(10) unsigned NOT NULL default '0',
171  content mediumtext NOT NULL,
172  PRIMARY KEY  (id)
173) ENGINE=InnoDB DEFAULT CHARSET=utf8;
174SET character_set_client = @saved_cs_client;
175
176--
177-- Table structure for table `threads`
178--
179
180DROP TABLE IF EXISTS threads;
181SET @saved_cs_client     = @@character_set_client;
182SET character_set_client = utf8;
183CREATE TABLE threads (
184  id int(10) unsigned NOT NULL auto_increment,
185  forum_id int(10) unsigned NOT NULL default '0',
186  `subject` varchar(48) NOT NULL default 'Untitled Thread',
187  blurb varchar(96) NOT NULL default '',
188  first_post_id int(10) unsigned NOT NULL,
189  last_post_id int(10) unsigned NOT NULL,
190  last_post_time int(10) unsigned NOT NULL default '0',
191  post_count int(10) unsigned NOT NULL default '0',
192  view_count int(10) unsigned NOT NULL default '0',
193  flags set('locked','sticky','announcement','deleted') NOT NULL default '',
194  PRIMARY KEY  (id),
195  KEY FORUMID USING BTREE (forum_id)
196) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
197SET character_set_client = @saved_cs_client;
198
199--
200-- Table structure for table `thread_views`
201--
202
203DROP TABLE IF EXISTS thread_views;
204SET @saved_cs_client     = @@character_set_client;
205SET character_set_client = utf8;
206CREATE TABLE thread_views (
207  thread_id int(10) unsigned NOT NULL,
208  user_id int(10) unsigned NOT NULL,
209  last_viewed int(10) unsigned NOT NULL,
210  PRIMARY KEY  (thread_id,user_id)
211) ENGINE=InnoDB DEFAULT CHARSET=utf8;
212SET character_set_client = @saved_cs_client;
213
214--
215-- Table structure for table `user_groups`
216--
217
218DROP TABLE IF EXISTS user_groups;
219SET @saved_cs_client     = @@character_set_client;
220SET character_set_client = utf8;
221CREATE TABLE user_groups (
222  user_id int(10) unsigned NOT NULL default '0',
223  group_id tinyint(3) unsigned NOT NULL default '0',
224  priority tinyint(3) unsigned NOT NULL default '0',
225  PRIMARY KEY  USING BTREE (user_id,group_id,priority),
226  KEY user_id USING BTREE (user_id),
227  KEY group_id USING BTREE (group_id)
228) ENGINE=InnoDB DEFAULT CHARSET=utf8;
229SET character_set_client = @saved_cs_client;
230
231--
232-- Table structure for table `users`
233--
234
235DROP TABLE IF EXISTS users;
236SET @saved_cs_client     = @@character_set_client;
237SET character_set_client = utf8;
238CREATE TABLE users (
239  id int(10) unsigned NOT NULL auto_increment,
240  `name` varchar(20) NOT NULL default '',
241  `password` varchar(40) NOT NULL,
242  time_joined int(10) unsigned NOT NULL default '0',
243  time_active int(10) unsigned NOT NULL default '0',
244  thread_view_cutoff int(10) unsigned NOT NULL,
245  post_count int(10) unsigned NOT NULL default '0',
246  flags set('lockedsig','lockedavatar','lockedtitle') NOT NULL default '',
247  news_pic varchar(64) default NULL,
248  avatar varchar(64) default NULL,
249  contact_aim varchar(32) NOT NULL default '',
250  contact_icq varchar(32) NOT NULL default '',
251  contact_msn varchar(32) NOT NULL default '',
252  contact_yim varchar(32) NOT NULL default '',
253  contact_lj varchar(32) NOT NULL default '',
254  contact_homepage varchar(96) NOT NULL default '',
255  contact_email varchar(32) NOT NULL default '',
256  pm_icon enum('bead','bellossom','dream','duskull','eatmail','gorgeous','letter','magnemite','pika','retro','slakoth','vee','wailmer','wingull','zigzagoon') NOT NULL default 'letter',
257  custom_title varchar(32) NOT NULL,
258  signature mediumtext NOT NULL,
259  is_dumb tinyint(1) NOT NULL default '0',
260  PRIMARY KEY  (id),
261  UNIQUE KEY `NAME` (`name`)
262) ENGINE=InnoDB DEFAULT CHARSET=utf8;
263SET character_set_client = @saved_cs_client;
264/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
265
266/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
267/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
268/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
269/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
270/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
271/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
272/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
Note: See TracBrowser for help on using the browser.