) /*$wgDBTableOptions*/;
CREATE UNIQUE INDEX /*i*/iwl_from ON /*_*/iwlinks (iwl_from, iwl_prefix, iwl_title);
-CREATE INDEX /*i*/iwl_prefix ON /*_*/iwlinks (iwl_prefix, iwl_title);
+CREATE INDEX /*i*/iwl_prefix_from_title ON /*_*/iwlinks (iwl_prefix, iwl_from, iwl_title);
--- /dev/null
+--
+-- Recreates the iwl_prefix for the iwlinks table
+--
+DROP INDEX /*i*/iwl_prefix ON /*_*/iwlinks;
+CREATE INDEX /*i*/iwl_prefix_from_title ON /*_*/iwlinks (iwl_prefix, iwl_from, iwl_title);
\ No newline at end of file
) /*$wgDBTableOptions*/;
CREATE UNIQUE INDEX /*i*/iwl_from ON /*_*/iwlinks (iwl_from, iwl_prefix, iwl_title);
-CREATE INDEX /*i*/iwl_prefix ON /*_*/iwlinks (iwl_prefix, iwl_title);
+CREATE INDEX /*i*/iwl_prefix_from_title ON /*_*/iwlinks (iwl_prefix, iwl_from, iwl_title);
--
// 1.17
array( 'add_table', 'iwlinks', 'patch-iwlinks.sql' ),
+ array( 'add_index', 'iwlinks', 'iwl_prefix', 'patch-rename-iwl_prefix.sql' ),
),
);
}
}
+function drop_index_if_exists( $table, $index, $patch, $fullpath = false ) {
+ global $wgDatabase;
+ if ( $wgDatabase->indexExists( $table, $index ) ) {
+ wfOut( "Dropping $index from table $table... " );
+ if ( $fullpath ) {
+ $wgDatabase->sourceFile( $patch );
+ } else {
+ $wgDatabase->sourceFile( archive( $patch ) );
+ }
+ wfOut( "ok\n" );
+ } else {
+ wfOut( "...$index doesn't exist.\n" );
+ }
+}
+
function do_interwiki_update() {
# Check that interwiki table exists; if it doesn't source it
global $wgDatabase, $IP;