r46941 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r46940‎ | r46941 | r46942 >
Date:21:17, 6 February 2009
Author:ialex
Status:ok
Tags:
Comment:
Fix for r46460: use "CREATE INDEX ... ON ..." rather than inside "CREATE TABLE" so that SQLite doesn't throw an error when creating new tables
Modified paths:
  • /trunk/phase3/maintenance/tables.sql (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/tables.sql
@@ -1234,35 +1234,38 @@
12351235 ul_key varchar(255) NOT NULL PRIMARY KEY
12361236 ) /*$wgDBTableOptions*/;
12371237
 1238+
12381239 --- A table to track tags for revisions, logs and recent changes.
12391240 CREATE TABLE /*_*/change_tag (
12401241 ct_rc_id int NULL,
12411242 ct_log_id int NULL,
12421243 ct_rev_id int NULL,
12431244 ct_tag varchar(255) NOT NULL,
1244 - ct_params BLOB NULL,
1245 -
1246 - UNIQUE KEY (ct_rc_id,ct_tag),
1247 - UNIQUE KEY (ct_log_id,ct_tag),
1248 - UNIQUE KEY (ct_rev_id,ct_tag),
1249 - KEY (ct_tag,ct_rc_id,ct_rev_id,ct_log_id) -- Covering index, so we can pull all the info only out of the index.
 1245+ ct_params BLOB NULL
12501246 ) /*$wgDBTableOptions*/;
12511247
 1248+CREATE UNIQUE INDEX /*i*/change_tag_rc_tag ON /*_*/change_tag (ct_rc_id,ct_tag);
 1249+CREATE UNIQUE INDEX /*i*/change_tag_log_tag ON /*_*/change_tag (ct_log_id,ct_tag);
 1250+CREATE UNIQUE INDEX /*i*/change_tag_rev_tag ON /*_*/change_tag (ct_rev_id,ct_tag);
 1251+-- Covering index, so we can pull all the info only out of the index.
 1252+CREATE INDEX /*i*/change_tag_tag_id ON /*_*/change_tag (ct_tag,ct_rc_id,ct_rev_id,ct_log_id);
 1253+
 1254+
12521255 -- Rollup table to pull a LIST of tags simply without ugly GROUP_CONCAT that only works on MySQL 4.1+
12531256 CREATE TABLE /*_*/tag_summary (
12541257 ts_rc_id int NULL,
12551258 ts_log_id int NULL,
12561259 ts_rev_id int NULL,
1257 - ts_tags BLOB NOT NULL,
1258 -
1259 - UNIQUE KEY (ts_rc_id),
1260 - UNIQUE KEY (ts_log_id),
1261 - UNIQUE KEY (ts_rev_id)
 1260+ ts_tags BLOB NOT NULL
12621261 ) /*$wgDBTableOptions*/;
12631262
 1263+CREATE UNIQUE INDEX /*i*/tag_summary_rc_id ON /*_*/tag_summary (ts_rc_id);
 1264+CREATE UNIQUE INDEX /*i*/tag_summary_log_id ON /*_*/tag_summary (ts_log_id);
 1265+CREATE UNIQUE INDEX /*i*/tag_summary_rev_id ON /*_*/tag_summary (ts_rev_id);
 1266+
 1267+
12641268 CREATE TABLE /*_*/valid_tag (
1265 - vt_tag varchar(255) NOT NULL,
1266 - PRIMARY KEY (vt_tag)
 1269+ vt_tag varchar(255) NOT NULL PRIMARY KEY
12671270 ) /*$wgDBTableOptions*/;
12681271
12691272

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r46460Branch merge of change-tagging branch with trunk...werdna19:08, 28 January 2009

Status & tagging log