Attempt at changing postgres as per r66892
authorSam Reed <reedy@users.mediawiki.org>
Tue, 25 May 2010 21:36:56 +0000 (21:36 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Tue, 25 May 2010 21:36:56 +0000 (21:36 +0000)
OverlordQ or someone, can you review please?

maintenance/postgres/archives/patch-rename-iwl_prefix.sql [new file with mode: 0644]
maintenance/postgres/tables.sql
maintenance/updaters.inc

diff --git a/maintenance/postgres/archives/patch-rename-iwl_prefix.sql b/maintenance/postgres/archives/patch-rename-iwl_prefix.sql
new file mode 100644 (file)
index 0000000..ebe0abc
--- /dev/null
@@ -0,0 +1,2 @@
+DROP INDEX iwl_prefix;
+CREATE INDEX iwl_prefix_from_title ON iwlinks (iwl_prefix, iwl_from, iwl_title);
\ No newline at end of file
index 0f8ae56..1f6e95f 100644 (file)
@@ -622,4 +622,4 @@ CREATE TABLE iwlinks (
         iwl_title TEXT NOT NULL DEFAULT ''
 );
 CREATE UNIQUE INDEX iwl_from ON iwlinks (iwl_from, iwl_prefix, iwl_title);
-CREATE INDEX iwl_prefix ON iwlinks (iwl_prefix, iwl_title);
+CREATE INDEX iwl_prefix_from_title ON iwlinks (iwl_prefix, iwl_from, iwl_title);
index 8674add..f06b71e 100644 (file)
@@ -1966,6 +1966,12 @@ function do_postgres_updates() {
                wfOut( "Adding ipb_address_unique index\n" );
                $wgDatabase->sourceFile( archive( 'patch-ipb_address_unique.sql' ) );
        }
+       
+       # Fix iwlinks index
+       if ( pg_index_exists( 'iwlinks', 'iwl_prefix' ) ) {
+               wfOut( "Replacing index 'iwl_prefix' with 'iwl_prefix_from_title'...\n" );
+               $wgDatabase->sourceFile( archive( 'patch-ipb_address_unique.sql' ) );
+       }
 
        global $wgExtNewTables, $wgExtPGNewFields, $wgExtPGAlteredFields, $wgExtNewIndexes;
        # Add missing extension tables