Merge "Clean up applyPatch() usage in the installer."
authorCatrope <roan.kattouw@gmail.com>
Wed, 22 Aug 2012 01:45:42 +0000 (01:45 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 22 Aug 2012 01:45:42 +0000 (01:45 +0000)
1  2 
includes/installer/OracleUpdater.php

@@@ -193,28 -174,9 +175,26 @@@ class OracleUpdater extends DatabaseUpd
                        return;
                }
  
-               $this->applyPatch( 'patch_recentchanges_fk2_cascade.sql', false );
-               $this->output( "ok\n" );
+               $this->applyPatch( 'patch_recentchanges_fk2_cascade.sql', false, "Altering RECENTCHANGES_FK2" );
        }
  
 +      /**
 +       * Fixed wrong PK, UK definition
 +       */
 +      protected function doPageRestrictionsPKUKFix() {
 +              $this->output( "Altering PAGE_RESTRICTIONS keys ... " );
 +
 +              $meta = $this->db->query( 'SELECT column_name FROM all_cons_columns WHERE owner = \''.strtoupper($this->db->getDBname()).'\' AND constraint_name = \'MW_PAGE_RESTRICTIONS_PK\' AND rownum = 1' );
 +              $row = $meta->fetchRow();
 +              if ( $row['column_name'] == 'PR_ID' ) {
 +                      $this->output( "seems to be up to date.\n" );
 +                      return;
 +              }
 +
 +              $this->applyPatch( 'patch-page_restrictions_pkuk_fix.sql', false );
 +              $this->output( "ok\n" );
 +      }
 +
        /**
         * rebuilding of the function that duplicates tables for tests
         */