* rename non-PRIMARY indices that were implicitly named before r45764 back to their implicit names
* add the renamed un_user_id and un_user_ip to the indexName() rewrite
* use consistent casing for PRIMARY KEY
*/
function indexName( $index ) {
// Backwards-compatibility hack
*/
function indexName( $index ) {
// Backwards-compatibility hack
- if ( $index == 'ar_usertext_timestamp' ) {
- return 'usertext_timestamp';
+ $renamed = array(
+ 'ar_usertext_timestamp' => 'usertext_timestamp',
+ 'un_user_id' => 'user_id',
+ 'un_user_ip' => 'user_ip',
+ );
+ if( isset( $renamed[$index] ) ) {
+ return $renamed[$index];
} else {
return $index;
}
} else {
return $index;
}
) /*$wgDBTableOptions*/;
CREATE UNIQUE INDEX /*i*/pl_from ON /*_*/pagelinks (pl_from,pl_namespace,pl_title);
) /*$wgDBTableOptions*/;
CREATE UNIQUE INDEX /*i*/pl_from ON /*_*/pagelinks (pl_from,pl_namespace,pl_title);
-CREATE INDEX /*i*/pl_namespace_title ON /*_*/pagelinks (pl_namespace,pl_title,pl_from);
+CREATE INDEX /*i*/pl_namespace ON /*_*/pagelinks (pl_namespace,pl_title,pl_from);
) /*$wgDBTableOptions*/;
CREATE UNIQUE INDEX /*i*/tl_from ON /*_*/templatelinks (tl_from,tl_namespace,tl_title);
) /*$wgDBTableOptions*/;
CREATE UNIQUE INDEX /*i*/tl_from ON /*_*/templatelinks (tl_from,tl_namespace,tl_title);
-CREATE INDEX /*i*/tl_namespace_title ON /*_*/templatelinks (tl_namespace,tl_title,tl_from);
+CREATE INDEX /*i*/tl_namespace ON /*_*/templatelinks (tl_namespace,tl_title,tl_from);
) /*$wgDBTableOptions*/;
CREATE UNIQUE INDEX /*i*/ll_from ON /*_*/langlinks (ll_from, ll_lang);
) /*$wgDBTableOptions*/;
CREATE UNIQUE INDEX /*i*/ll_from ON /*_*/langlinks (ll_from, ll_lang);
-CREATE INDEX /*i*/ll_lang_title ON /*_*/langlinks (ll_lang, ll_title);
+CREATE INDEX /*i*/ll_lang ON /*_*/langlinks (ll_lang, ll_title);
-- Filename.
-- This is also the title of the associated description page,
-- which will be in namespace 6 (NS_FILE).
-- Filename.
-- This is also the title of the associated description page,
-- which will be in namespace 6 (NS_FILE).
- img_name varchar(255) binary NOT NULL default '' primary key,
+ img_name varchar(255) binary NOT NULL default '' PRIMARY KEY,
-- File size in bytes.
img_size int unsigned NOT NULL default 0,
-- File size in bytes.
img_size int unsigned NOT NULL default 0,
-- pick out by image name
CREATE INDEX /*i*/fa_name ON /*_*/filearchive (fa_name, fa_timestamp);
-- pick out dupe files
-- pick out by image name
CREATE INDEX /*i*/fa_name ON /*_*/filearchive (fa_name, fa_timestamp);
-- pick out dupe files
-CREATE INDEX /*i*/fa_group_key ON /*_*/filearchive (fa_storage_group, fa_storage_key);
+CREATE INDEX /*i*/fa_storage_group ON /*_*/filearchive (fa_storage_group, fa_storage_key);
-- sort by deletion time
CREATE INDEX /*i*/fa_deleted_timestamp ON /*_*/filearchive (fa_deleted_timestamp);
-- sort by uploader
-- sort by deletion time
CREATE INDEX /*i*/fa_deleted_timestamp ON /*_*/filearchive (fa_deleted_timestamp);
-- sort by uploader
-CREATE UNIQUE INDEX /*i*/wl_user_namespace_title ON /*_*/watchlist (wl_user, wl_namespace, wl_title);
+CREATE UNIQUE INDEX /*i*/wl_user ON /*_*/watchlist (wl_user, wl_namespace, wl_title);
CREATE INDEX /*i*/namespace_title ON /*_*/watchlist (wl_namespace, wl_title);
CREATE INDEX /*i*/namespace_title ON /*_*/watchlist (wl_namespace, wl_title);
qc_title varchar(255) binary NOT NULL default ''
) /*$wgDBTableOptions*/;
qc_title varchar(255) binary NOT NULL default ''
) /*$wgDBTableOptions*/;
-CREATE INDEX /*i*/qc_type_value ON /*_*/querycache (qc_type,qc_value);
+CREATE INDEX /*i*/qc_type ON /*_*/querycache (qc_type,qc_value);
--
-- For a few generic cache operations if not using Memcached
--
CREATE TABLE /*_*/objectcache (
--
-- For a few generic cache operations if not using Memcached
--
CREATE TABLE /*_*/objectcache (
- keyname varbinary(255) NOT NULL default '' primary key,
+ keyname varbinary(255) NOT NULL default '' PRIMARY KEY,
value mediumblob,
exptime datetime
) /*$wgDBTableOptions*/;
value mediumblob,
exptime datetime
) /*$wgDBTableOptions*/;
-CREATE INDEX /*i*/oc_exptime ON /*_*/objectcache (exptime);
+CREATE INDEX /*i*/exptime ON /*_*/objectcache (exptime);
job_params blob NOT NULL
) /*$wgDBTableOptions*/;
job_params blob NOT NULL
) /*$wgDBTableOptions*/;
-CREATE INDEX /*i*/job_cmd_namespace_title ON /*_*/job (job_cmd, job_namespace, job_title);
+CREATE INDEX /*i*/job_cmd ON /*_*/job (job_cmd, job_namespace, job_title);
-- Details of updates to cached special pages
-- Details of updates to cached special pages
-- For each redirect, this table contains exactly one row defining its target
CREATE TABLE /*_*/redirect (
-- Key to the page_id of the redirect page
-- For each redirect, this table contains exactly one row defining its target
CREATE TABLE /*_*/redirect (
-- Key to the page_id of the redirect page
- rd_from int unsigned NOT NULL default 0 primary key,
+ rd_from int unsigned NOT NULL default 0 PRIMARY KEY,
-- Key to page_namespace/page_title of the target page.
-- The target page may or may not exist, and due to renames
-- Key to page_namespace/page_title of the target page.
-- The target page may or may not exist, and due to renames
-- A table to log updates, one text key row per update.
CREATE TABLE /*_*/updatelog (
-- A table to log updates, one text key row per update.
CREATE TABLE /*_*/updatelog (
- ul_key varchar(255) NOT NULL primary key
+ ul_key varchar(255) NOT NULL PRIMARY KEY
) /*$wgDBTableOptions*/;
-- vim: sw=2 sts=2 et
) /*$wgDBTableOptions*/;
-- vim: sw=2 sts=2 et