r59619 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r59618‎ | r59619 | r59620 >
Date:07:47, 1 December 2009
Author:aaron
Status:ok
Tags:
Comment:
Tweaks for SQLite
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.sql (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.sql
@@ -15,14 +15,14 @@
1616 fp_stable integer unsigned NOT NULL,
1717 -- The highest quality of the page's reviewed revisions.
1818 -- Note that this may not be set to display by default though.
19 - fp_quality tinyint(1) default NULL,
20 -
21 - PRIMARY KEY (fp_page_id),
22 - INDEX fp_reviewed_page (fp_reviewed,fp_page_id),
23 - INDEX fp_quality_page (fp_quality,fp_page_id),
24 - INDEX fp_pending_since (fp_pending_since)
 19+ fp_quality tinyint(1) default NULL
2520 ) /*$wgDBTableOptions*/;
2621
 22+CREATE UNIQUE INDEX /*i*/fp_page_id ON /*_*/flaggedpages (fp_page_id);
 23+CREATE INDEX /*i*/fp_reviewed_page ON /*_*/flaggedpages (fp_reviewed,fp_page_id);
 24+CREATE INDEX /*i*/fp_quality_page ON /*_*/flaggedpages (fp_quality,fp_page_id);
 25+CREATE INDEX /*i*/fp_pending_since ON /*_*/flaggedpages (fp_pending_since);
 26+
2727 -- Add tracking table for edits needing review (for all levels)
2828 CREATE TABLE IF NOT EXISTS /*$wgDBprefix*/flaggedpage_pending (
2929 -- Foreign key to page.page_id
@@ -32,12 +32,12 @@
3333 -- The last rev ID with this quality
3434 fpp_rev_id integer unsigned NOT NULL,
3535 -- Time of the first edit after the last revision reviewed to this level
36 - fpp_pending_since char(14) NOT NULL,
37 -
38 - PRIMARY KEY (fpp_page_id,fpp_quality),
39 - INDEX fpp_quality_pending (fpp_quality,fpp_pending_since)
 36+ fpp_pending_since char(14) NOT NULL
4037 ) /*$wgDBTableOptions*/;
4138
 39+CREATE UNIQUE INDEX /*i*/fpp_page_qal ON /*_*/flaggedpage_pending (fpp_page_id,fpp_quality);
 40+CREATE INDEX /*i*/fpp_quality_pending ON /*_*/flaggedpage_pending (fpp_quality,fpp_pending_since);
 41+
4242 -- This stores all of our revision reviews; it is the main table
4343 -- The template/file version data is stored in the next two tables
4444 CREATE TABLE IF NOT EXISTS /*$wgDBprefix*/flaggedrevs (
@@ -68,13 +68,13 @@
6969 -- Timestamp of file (when uploaded) (NULL if n/a)
7070 fr_img_timestamp char(14) NULL default NULL,
7171 -- Statistically unique SHA-1 key (NULL if n/a)
72 - fr_img_sha1 varbinary(32) NULL default NULL,
73 -
74 - PRIMARY KEY (fr_page_id,fr_rev_id),
75 - INDEX fr_img_sha1 (fr_img_sha1),
76 - INDEX page_qal_rev (fr_page_id,fr_quality,fr_rev_id)
 72+ fr_img_sha1 varbinary(32) NULL default NULL
7773 ) /*$wgDBTableOptions*/;
7874
 75+CREATE UNIQUE INDEX /*i*/fr_page_rev ON /*_*/flaggedrevs (fr_page_id,fr_rev_id);
 76+CREATE INDEX /*i*/fr_img_sha1 ON /*_*/flaggedrevs (fr_img_sha1);
 77+CREATE INDEX /*i*/page_qal_rev ON /*_*/flaggedrevs (fr_page_id,fr_quality,fr_rev_id);
 78+
7979 -- This stores all of our transclusion revision pointers
8080 CREATE TABLE IF NOT EXISTS /*$wgDBprefix*/flaggedtemplates (
8181 ft_rev_id integer unsigned NOT NULL,
@@ -82,11 +82,11 @@
8383 ft_namespace int NOT NULL default '0',
8484 ft_title varchar(255) binary NOT NULL default '',
8585 -- Revisions ID used when reviewed
86 - ft_tmp_rev_id integer unsigned NULL,
87 -
88 - PRIMARY KEY (ft_rev_id,ft_namespace,ft_title)
 86+ ft_tmp_rev_id integer unsigned NULL
8987 ) /*$wgDBTableOptions*/;
9088
 89+CREATE UNIQUE INDEX /*i*/ft_rev_namespace_title ON /*_*/flaggedtemplates (ft_rev_id,ft_namespace,ft_title);
 90+
9191 -- This stores all of our image revision pointers
9292 CREATE TABLE IF NOT EXISTS /*$wgDBprefix*/flaggedimages (
9393 fi_rev_id integer unsigned NOT NULL,
@@ -95,11 +95,11 @@
9696 -- Timestamp of image used when reviewed
9797 fi_img_timestamp char(14) NOT NULL default '',
9898 -- Statistically unique SHA-1 key
99 - fi_img_sha1 varbinary(32) NOT NULL default '',
100 -
101 - PRIMARY KEY (fi_rev_id,fi_name)
 99+ fi_img_sha1 varbinary(32) NOT NULL default ''
102100 ) /*$wgDBTableOptions*/;
103101
 102+CREATE UNIQUE INDEX /*i*/fi_rev_name ON /*_*/flaggedimages (fi_rev_id,fi_name);
 103+
104104 -- This stores settings on how to select the stable/default revision
105105 CREATE TABLE IF NOT EXISTS /*$wgDBprefix*/flaggedpage_config (
106106 -- Foreign key to page.page_id
@@ -114,28 +114,27 @@
115115 -- The protection level (Sysop, etc) for autoreview
116116 fpc_level varbinary(60) NULL,
117117 -- Field for time-limited settings
118 - fpc_expiry varbinary(14) NOT NULL default 'infinity',
119 -
120 - PRIMARY KEY (fpc_page_id),
121 - INDEX (fpc_expiry)
 118+ fpc_expiry varbinary(14) NOT NULL default 'infinity'
122119 ) /*$wgDBTableOptions*/;
123120
 121+CREATE UNIQUE INDEX /*i*/fpc_page_id ON /*_*/flaggedpage_config (fpc_page_id);
 122+CREATE INDEX /*i*/fpc_expiry ON /*_*/flaggedpage_config (fpc_expiry);
 123+
124124 -- Track includes/links only in stable versions
125125 CREATE TABLE IF NOT EXISTS /*$wgDBprefix*/flaggedrevs_tracking (
126126 ftr_from integer unsigned NOT NULL default '0',
127127 ftr_namespace int NOT NULL default '0',
128 - ftr_title varchar(255) binary NOT NULL default '',
129 -
130 - PRIMARY KEY (ftr_from,ftr_namespace,ftr_title),
131 - INDEX namespace_title_from (ftr_namespace,ftr_title,ftr_from)
 128+ ftr_title varchar(255) binary NOT NULL default ''
132129 ) /*$wgDBTableOptions*/;
133130
 131+CREATE UNIQUE INDEX /*i*/from_namespace_title ON /*_*/flaggedrevs_tracking (ftr_from,ftr_namespace,ftr_title);
 132+CREATE INDEX /*i*/namespace_title_from ON /*_*/flaggedrevs_tracking (ftr_namespace,ftr_title,ftr_from);
 133+
134134 -- This stores user demotions and stats
135135 CREATE TABLE IF NOT EXISTS /*$wgDBprefix*/flaggedrevs_promote (
136136 -- Foreign key to user.user_id
137137 frp_user_id integer unsigned NOT NULL,
138 - frp_user_params mediumblob NOT NULL,
139 -
140 - PRIMARY KEY (frp_user_id)
 138+ frp_user_params mediumblob NOT NULL
141139 ) /*$wgDBTableOptions*/;
142140
 141+CREATE UNIQUE INDEX /*i*/frp_user_id ON /*_*/flaggedrevs_promote (frp_user_id);

Follow-up revisions

RevisionCommit summaryAuthorDate
r59831Partial revert of r59619: declare certain indexes PRIMARY again for 'use inde...aaron16:43, 8 December 2009

Status & tagging log