Index: trunk/phase3/maintenance/tables.sql |
— | — | @@ -408,7 +408,7 @@ |
409 | 409 | ) /*$wgDBTableOptions*/; |
410 | 410 | |
411 | 411 | CREATE UNIQUE INDEX /*i*/pl_from ON /*_*/pagelinks (pl_from,pl_namespace,pl_title); |
412 | | -CREATE INDEX /*i*/pl_namespace_title ON /*_*/pagelinks (pl_namespace,pl_title,pl_from); |
| 412 | +CREATE INDEX /*i*/pl_namespace ON /*_*/pagelinks (pl_namespace,pl_title,pl_from); |
413 | 413 | |
414 | 414 | |
415 | 415 | -- |
— | — | @@ -427,7 +427,7 @@ |
428 | 428 | ) /*$wgDBTableOptions*/; |
429 | 429 | |
430 | 430 | CREATE UNIQUE INDEX /*i*/tl_from ON /*_*/templatelinks (tl_from,tl_namespace,tl_title); |
431 | | -CREATE INDEX /*i*/tl_namespace_title ON /*_*/templatelinks (tl_namespace,tl_title,tl_from); |
| 431 | +CREATE INDEX /*i*/tl_namespace ON /*_*/templatelinks (tl_namespace,tl_title,tl_from); |
432 | 432 | |
433 | 433 | |
434 | 434 | -- |
— | — | @@ -563,7 +563,7 @@ |
564 | 564 | ) /*$wgDBTableOptions*/; |
565 | 565 | |
566 | 566 | CREATE UNIQUE INDEX /*i*/ll_from ON /*_*/langlinks (ll_from, ll_lang); |
567 | | -CREATE INDEX /*i*/ll_lang_title ON /*_*/langlinks (ll_lang, ll_title); |
| 567 | +CREATE INDEX /*i*/ll_lang ON /*_*/langlinks (ll_lang, ll_title); |
568 | 568 | |
569 | 569 | |
570 | 570 | -- |
— | — | @@ -697,7 +697,7 @@ |
698 | 698 | -- Filename. |
699 | 699 | -- This is also the title of the associated description page, |
700 | 700 | -- which will be in namespace 6 (NS_FILE). |
701 | | - img_name varchar(255) binary NOT NULL default '' primary key, |
| 701 | + img_name varchar(255) binary NOT NULL default '' PRIMARY KEY, |
702 | 702 | |
703 | 703 | -- File size in bytes. |
704 | 704 | img_size int unsigned NOT NULL default 0, |
— | — | @@ -838,7 +838,7 @@ |
839 | 839 | -- pick out by image name |
840 | 840 | CREATE INDEX /*i*/fa_name ON /*_*/filearchive (fa_name, fa_timestamp); |
841 | 841 | -- pick out dupe files |
842 | | -CREATE INDEX /*i*/fa_group_key ON /*_*/filearchive (fa_storage_group, fa_storage_key); |
| 842 | +CREATE INDEX /*i*/fa_storage_group ON /*_*/filearchive (fa_storage_group, fa_storage_key); |
843 | 843 | -- sort by deletion time |
844 | 844 | CREATE INDEX /*i*/fa_deleted_timestamp ON /*_*/filearchive (fa_deleted_timestamp); |
845 | 845 | -- sort by uploader |
— | — | @@ -943,7 +943,7 @@ |
944 | 944 | |
945 | 945 | ) /*$wgDBTableOptions*/; |
946 | 946 | |
947 | | -CREATE UNIQUE INDEX /*i*/wl_user_namespace_title ON /*_*/watchlist (wl_user, wl_namespace, wl_title); |
| 947 | +CREATE UNIQUE INDEX /*i*/wl_user ON /*_*/watchlist (wl_user, wl_namespace, wl_title); |
948 | 948 | CREATE INDEX /*i*/namespace_title ON /*_*/watchlist (wl_namespace, wl_title); |
949 | 949 | |
950 | 950 | |
— | — | @@ -1034,18 +1034,18 @@ |
1035 | 1035 | qc_title varchar(255) binary NOT NULL default '' |
1036 | 1036 | ) /*$wgDBTableOptions*/; |
1037 | 1037 | |
1038 | | -CREATE INDEX /*i*/qc_type_value ON /*_*/querycache (qc_type,qc_value); |
| 1038 | +CREATE INDEX /*i*/qc_type ON /*_*/querycache (qc_type,qc_value); |
1039 | 1039 | |
1040 | 1040 | |
1041 | 1041 | -- |
1042 | 1042 | -- For a few generic cache operations if not using Memcached |
1043 | 1043 | -- |
1044 | 1044 | CREATE TABLE /*_*/objectcache ( |
1045 | | - keyname varbinary(255) NOT NULL default '' primary key, |
| 1045 | + keyname varbinary(255) NOT NULL default '' PRIMARY KEY, |
1046 | 1046 | value mediumblob, |
1047 | 1047 | exptime datetime |
1048 | 1048 | ) /*$wgDBTableOptions*/; |
1049 | | -CREATE INDEX /*i*/oc_exptime ON /*_*/objectcache (exptime); |
| 1049 | +CREATE INDEX /*i*/exptime ON /*_*/objectcache (exptime); |
1050 | 1050 | |
1051 | 1051 | |
1052 | 1052 | -- |
— | — | @@ -1126,7 +1126,7 @@ |
1127 | 1127 | job_params blob NOT NULL |
1128 | 1128 | ) /*$wgDBTableOptions*/; |
1129 | 1129 | |
1130 | | -CREATE INDEX /*i*/job_cmd_namespace_title ON /*_*/job (job_cmd, job_namespace, job_title); |
| 1130 | +CREATE INDEX /*i*/job_cmd ON /*_*/job (job_cmd, job_namespace, job_title); |
1131 | 1131 | |
1132 | 1132 | |
1133 | 1133 | -- Details of updates to cached special pages |
— | — | @@ -1145,7 +1145,7 @@ |
1146 | 1146 | -- For each redirect, this table contains exactly one row defining its target |
1147 | 1147 | CREATE TABLE /*_*/redirect ( |
1148 | 1148 | -- Key to the page_id of the redirect page |
1149 | | - rd_from int unsigned NOT NULL default 0 primary key, |
| 1149 | + rd_from int unsigned NOT NULL default 0 PRIMARY KEY, |
1150 | 1150 | |
1151 | 1151 | -- Key to page_namespace/page_title of the target page. |
1152 | 1152 | -- The target page may or may not exist, and due to renames |
— | — | @@ -1231,7 +1231,7 @@ |
1232 | 1232 | |
1233 | 1233 | -- A table to log updates, one text key row per update. |
1234 | 1234 | CREATE TABLE /*_*/updatelog ( |
1235 | | - ul_key varchar(255) NOT NULL primary key |
| 1235 | + ul_key varchar(255) NOT NULL PRIMARY KEY |
1236 | 1236 | ) /*$wgDBTableOptions*/; |
1237 | 1237 | |
1238 | 1238 | -- vim: sw=2 sts=2 et |
Index: trunk/phase3/includes/db/Database.php |
— | — | @@ -1579,8 +1579,13 @@ |
1580 | 1580 | */ |
1581 | 1581 | function indexName( $index ) { |
1582 | 1582 | // Backwards-compatibility hack |
1583 | | - if ( $index == 'ar_usertext_timestamp' ) { |
1584 | | - return 'usertext_timestamp'; |
| 1583 | + $renamed = array( |
| 1584 | + 'ar_usertext_timestamp' => 'usertext_timestamp', |
| 1585 | + 'un_user_id' => 'user_id', |
| 1586 | + 'un_user_ip' => 'user_ip', |
| 1587 | + ); |
| 1588 | + if( isset( $renamed[$index] ) ) { |
| 1589 | + return $renamed[$index]; |
1585 | 1590 | } else { |
1586 | 1591 | return $index; |
1587 | 1592 | } |