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