Index: trunk/phase3/maintenance/archives/patch-rename-iwl_prefix.sql |
— | — | @@ -0,0 +1,5 @@ |
| 2 | +-- |
| 3 | +-- Recreates the iwl_prefix for the iwlinks table |
| 4 | +-- |
| 5 | +DROP INDEX /*i*/iwl_prefix ON /*_*/iwlinks; |
| 6 | +CREATE INDEX /*i*/iwl_prefix_from_title ON /*_*/iwlinks (iwl_prefix, iwl_from, iwl_title); |
\ No newline at end of file |
Property changes on: trunk/phase3/maintenance/archives/patch-rename-iwl_prefix.sql |
___________________________________________________________________ |
Name: svn:eol-style |
1 | 7 | + native |
Index: trunk/phase3/maintenance/archives/patch-iwlinks.sql |
— | — | @@ -13,4 +13,4 @@ |
14 | 14 | ) /*$wgDBTableOptions*/; |
15 | 15 | |
16 | 16 | CREATE UNIQUE INDEX /*i*/iwl_from ON /*_*/iwlinks (iwl_from, iwl_prefix, iwl_title); |
17 | | -CREATE INDEX /*i*/iwl_prefix ON /*_*/iwlinks (iwl_prefix, iwl_title); |
| 17 | +CREATE INDEX /*i*/iwl_prefix_from_title ON /*_*/iwlinks (iwl_prefix, iwl_from, iwl_title); |
Index: trunk/phase3/maintenance/updaters.inc |
— | — | @@ -205,6 +205,7 @@ |
206 | 206 | |
207 | 207 | // 1.17 |
208 | 208 | array( 'add_table', 'iwlinks', 'patch-iwlinks.sql' ), |
| 209 | + array( 'add_index', 'iwlinks', 'iwl_prefix', 'patch-rename-iwl_prefix.sql' ), |
209 | 210 | ), |
210 | 211 | ); |
211 | 212 | |
— | — | @@ -315,6 +316,21 @@ |
316 | 317 | } |
317 | 318 | } |
318 | 319 | |
| 320 | +function drop_index_if_exists( $table, $index, $patch, $fullpath = false ) { |
| 321 | + global $wgDatabase; |
| 322 | + if ( $wgDatabase->indexExists( $table, $index ) ) { |
| 323 | + wfOut( "Dropping $index from table $table... " ); |
| 324 | + if ( $fullpath ) { |
| 325 | + $wgDatabase->sourceFile( $patch ); |
| 326 | + } else { |
| 327 | + $wgDatabase->sourceFile( archive( $patch ) ); |
| 328 | + } |
| 329 | + wfOut( "ok\n" ); |
| 330 | + } else { |
| 331 | + wfOut( "...$index doesn't exist.\n" ); |
| 332 | + } |
| 333 | +} |
| 334 | + |
319 | 335 | function do_interwiki_update() { |
320 | 336 | # Check that interwiki table exists; if it doesn't source it |
321 | 337 | global $wgDatabase, $IP; |
Index: trunk/phase3/maintenance/tables.sql |
— | — | @@ -623,7 +623,7 @@ |
624 | 624 | ) /*$wgDBTableOptions*/; |
625 | 625 | |
626 | 626 | CREATE UNIQUE INDEX /*i*/iwl_from ON /*_*/iwlinks (iwl_from, iwl_prefix, iwl_title); |
627 | | -CREATE INDEX /*i*/iwl_prefix ON /*_*/iwlinks (iwl_prefix, iwl_title); |
| 627 | +CREATE INDEX /*i*/iwl_prefix_from_title ON /*_*/iwlinks (iwl_prefix, iwl_from, iwl_title); |
628 | 628 | |
629 | 629 | |
630 | 630 | -- |