1 -- This is a copy of MediaWiki 1.18 schema shared by MySQL and SQLite.
2 -- It is used for updater testing. Comments are stripped to decrease
3 -- file size, as we don't need to maintain it.
5 CREATE TABLE /*_*/user (
6 user_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT,
7 user_name varchar(255) binary NOT NULL default '',
8 user_real_name varchar(255) binary NOT NULL default '',
9 user_password tinyblob NOT NULL,
10 user_newpassword tinyblob NOT NULL,
11 user_newpass_time binary(14),
12 user_email tinytext NOT NULL,
13 user_options blob NOT NULL,
14 user_touched binary(14) NOT NULL default '',
15 user_token binary(32) NOT NULL default '',
16 user_email_authenticated binary(14),
17 user_email_token binary(32),
18 user_email_token_expires binary(14),
19 user_registration binary(14),
21 ) /*$wgDBTableOptions*/;
22 CREATE UNIQUE INDEX /*i*/user_name ON /*_*/user (user_name);
23 CREATE INDEX /*i*/user_email_token ON /*_*/user (user_email_token);
24 CREATE INDEX /*i*/user_email ON /*_*/user (user_email(50));
25 CREATE TABLE /*_*/user_groups (
26 ug_user int unsigned NOT NULL default 0,
27 ug_group varbinary(16) NOT NULL default ''
28 ) /*$wgDBTableOptions*/;
29 CREATE UNIQUE INDEX /*i*/ug_user_group ON /*_*/user_groups (ug_user,ug_group);
30 CREATE INDEX /*i*/ug_group ON /*_*/user_groups (ug_group);
31 CREATE TABLE /*_*/user_former_groups (
32 ufg_user int unsigned NOT NULL default 0,
33 ufg_group varbinary(16) NOT NULL default ''
34 ) /*$wgDBTableOptions*/;
35 CREATE UNIQUE INDEX /*i*/ufg_user_group ON /*_*/user_former_groups (ufg_user,ufg_group);
36 CREATE TABLE /*_*/user_newtalk (
37 user_id int NOT NULL default 0,
38 user_ip varbinary(40) NOT NULL default '',
39 user_last_timestamp varbinary(14) NULL default NULL
40 ) /*$wgDBTableOptions*/;
41 CREATE INDEX /*i*/un_user_id ON /*_*/user_newtalk (user_id);
42 CREATE INDEX /*i*/un_user_ip ON /*_*/user_newtalk (user_ip);
43 CREATE TABLE /*_*/user_properties (
45 up_property varbinary(255) NOT NULL,
47 ) /*$wgDBTableOptions*/;
48 CREATE UNIQUE INDEX /*i*/user_properties_user_property ON /*_*/user_properties (up_user,up_property);
49 CREATE INDEX /*i*/user_properties_property ON /*_*/user_properties (up_property);
50 CREATE TABLE /*_*/page (
51 page_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT,
52 page_namespace int NOT NULL,
53 page_title varchar(255) binary NOT NULL,
54 page_restrictions tinyblob NOT NULL,
55 page_counter bigint unsigned NOT NULL default 0,
56 page_is_redirect tinyint unsigned NOT NULL default 0,
57 page_is_new tinyint unsigned NOT NULL default 0,
58 page_random real unsigned NOT NULL,
59 page_touched binary(14) NOT NULL default '',
60 page_latest int unsigned NOT NULL,
61 page_len int unsigned NOT NULL
62 ) /*$wgDBTableOptions*/;
63 CREATE UNIQUE INDEX /*i*/name_title ON /*_*/page (page_namespace,page_title);
64 CREATE INDEX /*i*/page_random ON /*_*/page (page_random);
65 CREATE INDEX /*i*/page_len ON /*_*/page (page_len);
66 CREATE TABLE /*_*/revision (
67 rev_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT,
68 rev_page int unsigned NOT NULL,
69 rev_text_id int unsigned NOT NULL,
70 rev_comment tinyblob NOT NULL,
71 rev_user int unsigned NOT NULL default 0,
72 rev_user_text varchar(255) binary NOT NULL default '',
73 rev_timestamp binary(14) NOT NULL default '',
74 rev_minor_edit tinyint unsigned NOT NULL default 0,
75 rev_deleted tinyint unsigned NOT NULL default 0,
77 rev_parent_id int unsigned default NULL
78 ) /*$wgDBTableOptions*/ MAX_ROWS=10000000 AVG_ROW_LENGTH=1024;
79 CREATE UNIQUE INDEX /*i*/rev_page_id ON /*_*/revision (rev_page, rev_id);
80 CREATE INDEX /*i*/rev_timestamp ON /*_*/revision (rev_timestamp);
81 CREATE INDEX /*i*/page_timestamp ON /*_*/revision (rev_page,rev_timestamp);
82 CREATE INDEX /*i*/user_timestamp ON /*_*/revision (rev_user,rev_timestamp);
83 CREATE INDEX /*i*/usertext_timestamp ON /*_*/revision (rev_user_text,rev_timestamp);
84 CREATE TABLE /*_*/text (
85 old_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT,
86 old_text mediumblob NOT NULL,
87 old_flags tinyblob NOT NULL
88 ) /*$wgDBTableOptions*/ MAX_ROWS=10000000 AVG_ROW_LENGTH=10240;
89 CREATE TABLE /*_*/archive (
90 ar_namespace int NOT NULL default 0,
91 ar_title varchar(255) binary NOT NULL default '',
92 ar_text mediumblob NOT NULL,
93 ar_comment tinyblob NOT NULL,
94 ar_user int unsigned NOT NULL default 0,
95 ar_user_text varchar(255) binary NOT NULL,
96 ar_timestamp binary(14) NOT NULL default '',
97 ar_minor_edit tinyint NOT NULL default 0,
98 ar_flags tinyblob NOT NULL,
99 ar_rev_id int unsigned,
100 ar_text_id int unsigned,
101 ar_deleted tinyint unsigned NOT NULL default 0,
103 ar_page_id int unsigned,
104 ar_parent_id int unsigned default NULL
105 ) /*$wgDBTableOptions*/;
106 CREATE INDEX /*i*/name_title_timestamp ON /*_*/archive (ar_namespace,ar_title,ar_timestamp);
107 CREATE INDEX /*i*/ar_usertext_timestamp ON /*_*/archive (ar_user_text,ar_timestamp);
108 CREATE INDEX /*i*/ar_revid ON /*_*/archive (ar_rev_id);
109 CREATE TABLE /*_*/pagelinks (
110 pl_from int unsigned NOT NULL default 0,
111 pl_namespace int NOT NULL default 0,
112 pl_title varchar(255) binary NOT NULL default ''
113 ) /*$wgDBTableOptions*/;
114 CREATE UNIQUE INDEX /*i*/pl_from ON /*_*/pagelinks (pl_from,pl_namespace,pl_title);
115 CREATE UNIQUE INDEX /*i*/pl_namespace ON /*_*/pagelinks (pl_namespace,pl_title,pl_from);
116 CREATE TABLE /*_*/templatelinks (
117 tl_from int unsigned NOT NULL default 0,
118 tl_namespace int NOT NULL default 0,
119 tl_title varchar(255) binary NOT NULL default ''
120 ) /*$wgDBTableOptions*/;
121 CREATE UNIQUE INDEX /*i*/tl_from ON /*_*/templatelinks (tl_from,tl_namespace,tl_title);
122 CREATE UNIQUE INDEX /*i*/tl_namespace ON /*_*/templatelinks (tl_namespace,tl_title,tl_from);
123 CREATE TABLE /*_*/imagelinks (
124 il_from int unsigned NOT NULL default 0,
125 il_to varchar(255) binary NOT NULL default ''
126 ) /*$wgDBTableOptions*/;
127 CREATE UNIQUE INDEX /*i*/il_from ON /*_*/imagelinks (il_from,il_to);
128 CREATE UNIQUE INDEX /*i*/il_to ON /*_*/imagelinks (il_to,il_from);
129 CREATE TABLE /*_*/categorylinks (
130 cl_from int unsigned NOT NULL default 0,
131 cl_to varchar(255) binary NOT NULL default '',
132 cl_sortkey varbinary(230) NOT NULL default '',
133 cl_sortkey_prefix varchar(255) binary NOT NULL default '',
134 cl_timestamp timestamp NOT NULL,
135 cl_collation varbinary(32) NOT NULL default '',
136 cl_type ENUM('page', 'subcat', 'file') NOT NULL default 'page'
137 ) /*$wgDBTableOptions*/;
138 CREATE UNIQUE INDEX /*i*/cl_from ON /*_*/categorylinks (cl_from,cl_to);
139 CREATE INDEX /*i*/cl_sortkey ON /*_*/categorylinks (cl_to,cl_type,cl_sortkey,cl_from);
140 CREATE INDEX /*i*/cl_timestamp ON /*_*/categorylinks (cl_to,cl_timestamp);
141 CREATE INDEX /*i*/cl_collation ON /*_*/categorylinks (cl_collation);
142 CREATE TABLE /*_*/category (
143 cat_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT,
144 cat_title varchar(255) binary NOT NULL,
145 cat_pages int signed NOT NULL default 0,
146 cat_subcats int signed NOT NULL default 0,
147 cat_files int signed NOT NULL default 0,
148 cat_hidden tinyint unsigned NOT NULL default 0
149 ) /*$wgDBTableOptions*/;
150 CREATE UNIQUE INDEX /*i*/cat_title ON /*_*/category (cat_title);
151 CREATE INDEX /*i*/cat_pages ON /*_*/category (cat_pages);
152 CREATE TABLE /*_*/externallinks (
153 el_from int unsigned NOT NULL default 0,
155 el_index blob NOT NULL
156 ) /*$wgDBTableOptions*/;
157 CREATE INDEX /*i*/el_from ON /*_*/externallinks (el_from, el_to(40));
158 CREATE INDEX /*i*/el_to ON /*_*/externallinks (el_to(60), el_from);
159 CREATE INDEX /*i*/el_index ON /*_*/externallinks (el_index(60));
160 CREATE TABLE /*_*/langlinks (
161 ll_from int unsigned NOT NULL default 0,
162 ll_lang varbinary(20) NOT NULL default '',
163 ll_title varchar(255) binary NOT NULL default ''
164 ) /*$wgDBTableOptions*/;
165 CREATE UNIQUE INDEX /*i*/ll_from ON /*_*/langlinks (ll_from, ll_lang);
166 CREATE INDEX /*i*/ll_lang ON /*_*/langlinks (ll_lang, ll_title);
167 CREATE TABLE /*_*/iwlinks (
168 iwl_from int unsigned NOT NULL default 0,
169 iwl_prefix varbinary(20) NOT NULL default '',
170 iwl_title varchar(255) binary NOT NULL default ''
171 ) /*$wgDBTableOptions*/;
172 CREATE UNIQUE INDEX /*i*/iwl_from ON /*_*/iwlinks (iwl_from, iwl_prefix, iwl_title);
173 CREATE UNIQUE INDEX /*i*/iwl_prefix_title_from ON /*_*/iwlinks (iwl_prefix, iwl_title, iwl_from);
174 CREATE TABLE /*_*/site_stats (
175 ss_row_id int unsigned NOT NULL,
176 ss_total_views bigint unsigned default 0,
177 ss_total_edits bigint unsigned default 0,
178 ss_good_articles bigint unsigned default 0,
179 ss_total_pages bigint default '-1',
180 ss_users bigint default '-1',
181 ss_active_users bigint default '-1',
182 ss_admins int default '-1',
183 ss_images int default 0
184 ) /*$wgDBTableOptions*/;
185 CREATE UNIQUE INDEX /*i*/ss_row_id ON /*_*/site_stats (ss_row_id);
186 CREATE TABLE /*_*/hitcounter (
187 hc_id int unsigned NOT NULL
188 ) ENGINE=HEAP MAX_ROWS=25000;
189 CREATE TABLE /*_*/ipblocks (
190 ipb_id int NOT NULL PRIMARY KEY AUTO_INCREMENT,
191 ipb_address tinyblob NOT NULL,
192 ipb_user int unsigned NOT NULL default 0,
193 ipb_by int unsigned NOT NULL default 0,
194 ipb_by_text varchar(255) binary NOT NULL default '',
195 ipb_reason tinyblob NOT NULL,
196 ipb_timestamp binary(14) NOT NULL default '',
197 ipb_auto bool NOT NULL default 0,
198 ipb_anon_only bool NOT NULL default 0,
199 ipb_create_account bool NOT NULL default 1,
200 ipb_enable_autoblock bool NOT NULL default '1',
201 ipb_expiry varbinary(14) NOT NULL default '',
202 ipb_range_start tinyblob NOT NULL,
203 ipb_range_end tinyblob NOT NULL,
204 ipb_deleted bool NOT NULL default 0,
205 ipb_block_email bool NOT NULL default 0,
206 ipb_allow_usertalk bool NOT NULL default 0
207 ) /*$wgDBTableOptions*/;
208 CREATE UNIQUE INDEX /*i*/ipb_address ON /*_*/ipblocks (ipb_address(255), ipb_user, ipb_auto, ipb_anon_only);
209 CREATE INDEX /*i*/ipb_user ON /*_*/ipblocks (ipb_user);
210 CREATE INDEX /*i*/ipb_range ON /*_*/ipblocks (ipb_range_start(8), ipb_range_end(8));
211 CREATE INDEX /*i*/ipb_timestamp ON /*_*/ipblocks (ipb_timestamp);
212 CREATE INDEX /*i*/ipb_expiry ON /*_*/ipblocks (ipb_expiry);
213 CREATE TABLE /*_*/image (
214 img_name varchar(255) binary NOT NULL default '' PRIMARY KEY,
215 img_size int unsigned NOT NULL default 0,
216 img_width int NOT NULL default 0,
217 img_height int NOT NULL default 0,
218 img_metadata mediumblob NOT NULL,
219 img_bits int NOT NULL default 0,
220 img_media_type ENUM("UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE") default NULL,
221 img_major_mime ENUM("unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart") NOT NULL default "unknown",
222 img_minor_mime varbinary(100) NOT NULL default "unknown",
223 img_description tinyblob NOT NULL,
224 img_user int unsigned NOT NULL default 0,
225 img_user_text varchar(255) binary NOT NULL,
226 img_timestamp varbinary(14) NOT NULL default '',
227 img_sha1 varbinary(32) NOT NULL default ''
228 ) /*$wgDBTableOptions*/;
229 CREATE INDEX /*i*/img_usertext_timestamp ON /*_*/image (img_user_text,img_timestamp);
230 CREATE INDEX /*i*/img_size ON /*_*/image (img_size);
231 CREATE INDEX /*i*/img_timestamp ON /*_*/image (img_timestamp);
232 CREATE INDEX /*i*/img_sha1 ON /*_*/image (img_sha1);
233 CREATE TABLE /*_*/oldimage (
234 oi_name varchar(255) binary NOT NULL default '',
235 oi_archive_name varchar(255) binary NOT NULL default '',
236 oi_size int unsigned NOT NULL default 0,
237 oi_width int NOT NULL default 0,
238 oi_height int NOT NULL default 0,
239 oi_bits int NOT NULL default 0,
240 oi_description tinyblob NOT NULL,
241 oi_user int unsigned NOT NULL default 0,
242 oi_user_text varchar(255) binary NOT NULL,
243 oi_timestamp binary(14) NOT NULL default '',
244 oi_metadata mediumblob NOT NULL,
245 oi_media_type ENUM("UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE") default NULL,
246 oi_major_mime ENUM("unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart") NOT NULL default "unknown",
247 oi_minor_mime varbinary(100) NOT NULL default "unknown",
248 oi_deleted tinyint unsigned NOT NULL default 0,
249 oi_sha1 varbinary(32) NOT NULL default ''
250 ) /*$wgDBTableOptions*/;
251 CREATE INDEX /*i*/oi_usertext_timestamp ON /*_*/oldimage (oi_user_text,oi_timestamp);
252 CREATE INDEX /*i*/oi_name_timestamp ON /*_*/oldimage (oi_name,oi_timestamp);
253 CREATE INDEX /*i*/oi_name_archive_name ON /*_*/oldimage (oi_name,oi_archive_name(14));
254 CREATE INDEX /*i*/oi_sha1 ON /*_*/oldimage (oi_sha1);
255 CREATE TABLE /*_*/filearchive (
256 fa_id int NOT NULL PRIMARY KEY AUTO_INCREMENT,
257 fa_name varchar(255) binary NOT NULL default '',
258 fa_archive_name varchar(255) binary default '',
259 fa_storage_group varbinary(16),
260 fa_storage_key varbinary(64) default '',
262 fa_deleted_timestamp binary(14) default '',
263 fa_deleted_reason text,
264 fa_size int unsigned default 0,
265 fa_width int default 0,
266 fa_height int default 0,
267 fa_metadata mediumblob,
268 fa_bits int default 0,
269 fa_media_type ENUM("UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE") default NULL,
270 fa_major_mime ENUM("unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart") default "unknown",
271 fa_minor_mime varbinary(100) default "unknown",
272 fa_description tinyblob,
273 fa_user int unsigned default 0,
274 fa_user_text varchar(255) binary,
275 fa_timestamp binary(14) default '',
276 fa_deleted tinyint unsigned NOT NULL default 0
277 ) /*$wgDBTableOptions*/;
278 CREATE INDEX /*i*/fa_name ON /*_*/filearchive (fa_name, fa_timestamp);
279 CREATE INDEX /*i*/fa_storage_group ON /*_*/filearchive (fa_storage_group, fa_storage_key);
280 CREATE INDEX /*i*/fa_deleted_timestamp ON /*_*/filearchive (fa_deleted_timestamp);
281 CREATE INDEX /*i*/fa_user_timestamp ON /*_*/filearchive (fa_user_text,fa_timestamp);
282 CREATE TABLE /*_*/uploadstash (
283 us_id int unsigned NOT NULL PRIMARY KEY auto_increment,
284 us_user int unsigned NOT NULL,
285 us_key varchar(255) NOT NULL,
286 us_orig_path varchar(255) NOT NULL,
287 us_path varchar(255) NOT NULL,
288 us_source_type varchar(50),
289 us_timestamp varbinary(14) not null,
290 us_status varchar(50) not null,
291 us_size int unsigned NOT NULL,
292 us_sha1 varchar(31) NOT NULL,
293 us_mime varchar(255),
294 us_media_type ENUM("UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE") default NULL,
295 us_image_width int unsigned,
296 us_image_height int unsigned,
297 us_image_bits smallint unsigned
298 ) /*$wgDBTableOptions*/;
299 CREATE INDEX /*i*/us_user ON /*_*/uploadstash (us_user);
300 CREATE UNIQUE INDEX /*i*/us_key ON /*_*/uploadstash (us_key);
301 CREATE INDEX /*i*/us_timestamp ON /*_*/uploadstash (us_timestamp);
302 CREATE TABLE /*_*/recentchanges (
303 rc_id int NOT NULL PRIMARY KEY AUTO_INCREMENT,
304 rc_timestamp varbinary(14) NOT NULL default '',
305 rc_cur_time varbinary(14) NOT NULL default '',
306 rc_user int unsigned NOT NULL default 0,
307 rc_user_text varchar(255) binary NOT NULL,
308 rc_namespace int NOT NULL default 0,
309 rc_title varchar(255) binary NOT NULL default '',
310 rc_comment varchar(255) binary NOT NULL default '',
311 rc_minor tinyint unsigned NOT NULL default 0,
312 rc_bot tinyint unsigned NOT NULL default 0,
313 rc_new tinyint unsigned NOT NULL default 0,
314 rc_cur_id int unsigned NOT NULL default 0,
315 rc_this_oldid int unsigned NOT NULL default 0,
316 rc_last_oldid int unsigned NOT NULL default 0,
317 rc_type tinyint unsigned NOT NULL default 0,
318 rc_moved_to_ns tinyint unsigned NOT NULL default 0,
319 rc_moved_to_title varchar(255) binary NOT NULL default '',
320 rc_patrolled tinyint unsigned NOT NULL default 0,
321 rc_ip varbinary(40) NOT NULL default '',
324 rc_deleted tinyint unsigned NOT NULL default 0,
325 rc_logid int unsigned NOT NULL default 0,
326 rc_log_type varbinary(255) NULL default NULL,
327 rc_log_action varbinary(255) NULL default NULL,
329 ) /*$wgDBTableOptions*/;
330 CREATE INDEX /*i*/rc_timestamp ON /*_*/recentchanges (rc_timestamp);
331 CREATE INDEX /*i*/rc_namespace_title ON /*_*/recentchanges (rc_namespace, rc_title);
332 CREATE INDEX /*i*/rc_cur_id ON /*_*/recentchanges (rc_cur_id);
333 CREATE INDEX /*i*/new_name_timestamp ON /*_*/recentchanges (rc_new,rc_namespace,rc_timestamp);
334 CREATE INDEX /*i*/rc_ip ON /*_*/recentchanges (rc_ip);
335 CREATE INDEX /*i*/rc_ns_usertext ON /*_*/recentchanges (rc_namespace, rc_user_text);
336 CREATE INDEX /*i*/rc_user_text ON /*_*/recentchanges (rc_user_text, rc_timestamp);
337 CREATE TABLE /*_*/watchlist (
338 wl_user int unsigned NOT NULL,
339 wl_namespace int NOT NULL default 0,
340 wl_title varchar(255) binary NOT NULL default '',
341 wl_notificationtimestamp varbinary(14)
342 ) /*$wgDBTableOptions*/;
343 CREATE UNIQUE INDEX /*i*/wl_user ON /*_*/watchlist (wl_user, wl_namespace, wl_title);
344 CREATE INDEX /*i*/namespace_title ON /*_*/watchlist (wl_namespace, wl_title);
345 CREATE TABLE /*_*/searchindex (
346 si_page int unsigned NOT NULL,
347 si_title varchar(255) NOT NULL default '',
348 si_text mediumtext NOT NULL
350 CREATE UNIQUE INDEX /*i*/si_page ON /*_*/searchindex (si_page);
351 CREATE FULLTEXT INDEX /*i*/si_title ON /*_*/searchindex (si_title);
352 CREATE FULLTEXT INDEX /*i*/si_text ON /*_*/searchindex (si_text);
353 CREATE TABLE /*_*/interwiki (
354 iw_prefix varchar(32) NOT NULL,
355 iw_url blob NOT NULL,
356 iw_api blob NOT NULL,
357 iw_wikiid varchar(64) NOT NULL,
358 iw_local bool NOT NULL,
359 iw_trans tinyint NOT NULL default 0
360 ) /*$wgDBTableOptions*/;
361 CREATE UNIQUE INDEX /*i*/iw_prefix ON /*_*/interwiki (iw_prefix);
362 CREATE TABLE /*_*/querycache (
363 qc_type varbinary(32) NOT NULL,
364 qc_value int unsigned NOT NULL default 0,
365 qc_namespace int NOT NULL default 0,
366 qc_title varchar(255) binary NOT NULL default ''
367 ) /*$wgDBTableOptions*/;
368 CREATE INDEX /*i*/qc_type ON /*_*/querycache (qc_type,qc_value);
369 CREATE TABLE /*_*/objectcache (
370 keyname varbinary(255) NOT NULL default '' PRIMARY KEY,
373 ) /*$wgDBTableOptions*/;
374 CREATE INDEX /*i*/exptime ON /*_*/objectcache (exptime);
375 CREATE TABLE /*_*/transcache (
376 tc_url varbinary(255) NOT NULL,
378 tc_time binary(14) NOT NULL
379 ) /*$wgDBTableOptions*/;
380 CREATE UNIQUE INDEX /*i*/tc_url_idx ON /*_*/transcache (tc_url);
381 CREATE TABLE /*_*/logging (
382 log_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT,
383 log_type varbinary(32) NOT NULL default '',
384 log_action varbinary(32) NOT NULL default '',
385 log_timestamp binary(14) NOT NULL default '19700101000000',
386 log_user int unsigned NOT NULL default 0,
387 log_user_text varchar(255) binary NOT NULL default '',
388 log_namespace int NOT NULL default 0,
389 log_title varchar(255) binary NOT NULL default '',
390 log_page int unsigned NULL,
391 log_comment varchar(255) NOT NULL default '',
392 log_params blob NOT NULL,
393 log_deleted tinyint unsigned NOT NULL default 0
394 ) /*$wgDBTableOptions*/;
395 CREATE INDEX /*i*/type_time ON /*_*/logging (log_type, log_timestamp);
396 CREATE INDEX /*i*/user_time ON /*_*/logging (log_user, log_timestamp);
397 CREATE INDEX /*i*/page_time ON /*_*/logging (log_namespace, log_title, log_timestamp);
398 CREATE INDEX /*i*/times ON /*_*/logging (log_timestamp);
399 CREATE INDEX /*i*/log_user_type_time ON /*_*/logging (log_user, log_type, log_timestamp);
400 CREATE INDEX /*i*/log_page_id_time ON /*_*/logging (log_page,log_timestamp);
401 CREATE TABLE /*_*/log_search (
402 ls_field varbinary(32) NOT NULL,
403 ls_value varchar(255) NOT NULL,
404 ls_log_id int unsigned NOT NULL default 0
405 ) /*$wgDBTableOptions*/;
406 CREATE UNIQUE INDEX /*i*/ls_field_val ON /*_*/log_search (ls_field,ls_value,ls_log_id);
407 CREATE INDEX /*i*/ls_log_id ON /*_*/log_search (ls_log_id);
408 CREATE TABLE /*_*/trackbacks (
409 tb_id int PRIMARY KEY AUTO_INCREMENT,
410 tb_page int REFERENCES /*_*/page(page_id) ON DELETE CASCADE,
411 tb_title varchar(255) NOT NULL,
412 tb_url blob NOT NULL,
415 ) /*$wgDBTableOptions*/;
416 CREATE INDEX /*i*/tb_page ON /*_*/trackbacks (tb_page);
417 CREATE TABLE /*_*/job (
418 job_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT,
419 job_cmd varbinary(60) NOT NULL default '',
420 job_namespace int NOT NULL,
421 job_title varchar(255) binary NOT NULL,
422 job_params blob NOT NULL
423 ) /*$wgDBTableOptions*/;
424 CREATE INDEX /*i*/job_cmd ON /*_*/job (job_cmd, job_namespace, job_title, job_params(128));
425 CREATE TABLE /*_*/querycache_info (
426 qci_type varbinary(32) NOT NULL default '',
427 qci_timestamp binary(14) NOT NULL default '19700101000000'
428 ) /*$wgDBTableOptions*/;
429 CREATE UNIQUE INDEX /*i*/qci_type ON /*_*/querycache_info (qci_type);
430 CREATE TABLE /*_*/redirect (
431 rd_from int unsigned NOT NULL default 0 PRIMARY KEY,
432 rd_namespace int NOT NULL default 0,
433 rd_title varchar(255) binary NOT NULL default '',
434 rd_interwiki varchar(32) default NULL,
435 rd_fragment varchar(255) binary default NULL
436 ) /*$wgDBTableOptions*/;
437 CREATE INDEX /*i*/rd_ns_title ON /*_*/redirect (rd_namespace,rd_title,rd_from);
438 CREATE TABLE /*_*/querycachetwo (
439 qcc_type varbinary(32) NOT NULL,
440 qcc_value int unsigned NOT NULL default 0,
441 qcc_namespace int NOT NULL default 0,
442 qcc_title varchar(255) binary NOT NULL default '',
443 qcc_namespacetwo int NOT NULL default 0,
444 qcc_titletwo varchar(255) binary NOT NULL default ''
445 ) /*$wgDBTableOptions*/;
446 CREATE INDEX /*i*/qcc_type ON /*_*/querycachetwo (qcc_type,qcc_value);
447 CREATE INDEX /*i*/qcc_title ON /*_*/querycachetwo (qcc_type,qcc_namespace,qcc_title);
448 CREATE INDEX /*i*/qcc_titletwo ON /*_*/querycachetwo (qcc_type,qcc_namespacetwo,qcc_titletwo);
449 CREATE TABLE /*_*/page_restrictions (
450 pr_page int NOT NULL,
451 pr_type varbinary(60) NOT NULL,
452 pr_level varbinary(60) NOT NULL,
453 pr_cascade tinyint NOT NULL,
455 pr_expiry varbinary(14) NULL,
456 pr_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT
457 ) /*$wgDBTableOptions*/;
458 CREATE UNIQUE INDEX /*i*/pr_pagetype ON /*_*/page_restrictions (pr_page,pr_type);
459 CREATE INDEX /*i*/pr_typelevel ON /*_*/page_restrictions (pr_type,pr_level);
460 CREATE INDEX /*i*/pr_level ON /*_*/page_restrictions (pr_level);
461 CREATE INDEX /*i*/pr_cascade ON /*_*/page_restrictions (pr_cascade);
462 CREATE TABLE /*_*/protected_titles (
463 pt_namespace int NOT NULL,
464 pt_title varchar(255) binary NOT NULL,
465 pt_user int unsigned NOT NULL,
467 pt_timestamp binary(14) NOT NULL,
468 pt_expiry varbinary(14) NOT NULL default '',
469 pt_create_perm varbinary(60) NOT NULL
470 ) /*$wgDBTableOptions*/;
471 CREATE UNIQUE INDEX /*i*/pt_namespace_title ON /*_*/protected_titles (pt_namespace,pt_title);
472 CREATE INDEX /*i*/pt_timestamp ON /*_*/protected_titles (pt_timestamp);
473 CREATE TABLE /*_*/page_props (
474 pp_page int NOT NULL,
475 pp_propname varbinary(60) NOT NULL,
476 pp_value blob NOT NULL
477 ) /*$wgDBTableOptions*/;
478 CREATE UNIQUE INDEX /*i*/pp_page_propname ON /*_*/page_props (pp_page,pp_propname);
479 CREATE TABLE /*_*/updatelog (
480 ul_key varchar(255) NOT NULL PRIMARY KEY,
482 ) /*$wgDBTableOptions*/;
483 CREATE TABLE /*_*/change_tag (
487 ct_tag varchar(255) NOT NULL,
489 ) /*$wgDBTableOptions*/;
490 CREATE UNIQUE INDEX /*i*/change_tag_rc_tag ON /*_*/change_tag (ct_rc_id,ct_tag);
491 CREATE UNIQUE INDEX /*i*/change_tag_log_tag ON /*_*/change_tag (ct_log_id,ct_tag);
492 CREATE UNIQUE INDEX /*i*/change_tag_rev_tag ON /*_*/change_tag (ct_rev_id,ct_tag);
493 CREATE INDEX /*i*/change_tag_tag_id ON /*_*/change_tag (ct_tag,ct_rc_id,ct_rev_id,ct_log_id);
494 CREATE TABLE /*_*/tag_summary (
498 ts_tags blob NOT NULL
499 ) /*$wgDBTableOptions*/;
500 CREATE UNIQUE INDEX /*i*/tag_summary_rc_id ON /*_*/tag_summary (ts_rc_id);
501 CREATE UNIQUE INDEX /*i*/tag_summary_log_id ON /*_*/tag_summary (ts_log_id);
502 CREATE UNIQUE INDEX /*i*/tag_summary_rev_id ON /*_*/tag_summary (ts_rev_id);
503 CREATE TABLE /*_*/valid_tag (
504 vt_tag varchar(255) NOT NULL PRIMARY KEY
505 ) /*$wgDBTableOptions*/;
506 CREATE TABLE /*_*/l10n_cache (
507 lc_lang varbinary(32) NOT NULL,
508 lc_key varchar(255) NOT NULL,
509 lc_value mediumblob NOT NULL
510 ) /*$wgDBTableOptions*/;
511 CREATE INDEX /*i*/lc_lang_key ON /*_*/l10n_cache (lc_lang, lc_key);
512 CREATE TABLE /*_*/msg_resource (
513 mr_resource varbinary(255) NOT NULL,
514 mr_lang varbinary(32) NOT NULL,
515 mr_blob mediumblob NOT NULL,
516 mr_timestamp binary(14) NOT NULL
517 ) /*$wgDBTableOptions*/;
518 CREATE UNIQUE INDEX /*i*/mr_resource_lang ON /*_*/msg_resource (mr_resource, mr_lang);
519 CREATE TABLE /*_*/msg_resource_links (
520 mrl_resource varbinary(255) NOT NULL,
521 mrl_message varbinary(255) NOT NULL
522 ) /*$wgDBTableOptions*/;
523 CREATE UNIQUE INDEX /*i*/mrl_message_resource ON /*_*/msg_resource_links (mrl_message, mrl_resource);
524 CREATE TABLE /*_*/module_deps (
525 md_module varbinary(255) NOT NULL,
526 md_skin varbinary(32) NOT NULL,
527 md_deps mediumblob NOT NULL
528 ) /*$wgDBTableOptions*/;
529 CREATE UNIQUE INDEX /*i*/md_module_skin ON /*_*/module_deps (md_module, md_skin);