(bug 38110) provide a way to separate out schema changes
[lhc/web/wiklou.git] / includes / installer / MysqlUpdater.php
index 113c65a..c00dc13 100644 (file)
@@ -155,8 +155,8 @@ class MysqlUpdater extends DatabaseUpdater {
                        // 1.15
                        array( 'doUniquePlTlIl' ),
                        array( 'addTable', 'change_tag',                        'patch-change_tag.sql' ),
-                       array( 'addTable', 'tag_summary',                       'patch-change_tag.sql' ),
-                       array( 'addTable', 'valid_tag',                         'patch-change_tag.sql' ),
+                       /* array( 'addTable', 'tag_summary',                       'patch-change_tag.sql' ), */
+                       /* array( 'addTable', 'valid_tag',                         'patch-change_tag.sql' ), */
 
                        // 1.16
                        array( 'addTable', 'user_properties',                   'patch-user_properties.sql' ),
@@ -641,6 +641,9 @@ class MysqlUpdater extends DatabaseUpdater {
         */
        protected function doWatchlistNull() {
                $info = $this->db->fieldInfo( 'watchlist', 'wl_notificationtimestamp' );
+               if ( !$info ) {
+                       return;
+               }
                if ( $info->isNullable() ) {
                        $this->output( "...wl_notificationtimestamp is already nullable.\n" );
                        return;
@@ -782,9 +785,10 @@ class MysqlUpdater extends DatabaseUpdater {
 
        protected function doMaybeProfilingMemoryUpdate() {
                if ( !$this->db->tableExists( 'profiling', __METHOD__ ) ) {
-                       // Simply ignore
+                       return true;
                } elseif ( $this->db->fieldExists( 'profiling', 'pf_memory', __METHOD__ ) ) {
                        $this->output( "...profiling table has pf_memory field.\n" );
+                       return true;
                } else {
                        $this->applyPatch( 'patch-profiling-memory.sql', false, "Adding pf_memory field to table profiling" );
                }
@@ -795,16 +799,21 @@ class MysqlUpdater extends DatabaseUpdater {
                if ( !$info ) {
                        $this->applyPatch( 'patch-filearchive-user-index.sql', false, "Updating filearchive indices" );
                }
+               return true;
        }
 
        protected function doUniquePlTlIl() {
                $info = $this->db->indexInfo( 'pagelinks', 'pl_namespace' );
                if ( is_array( $info ) && !$info[0]->Non_unique ) {
                        $this->output( "...pl_namespace, tl_namespace, il_to indices are already UNIQUE.\n" );
-                       return;
+                       return true;
+               }
+               if ( $this->skipSchema ) {
+                       $this->output( "...skipping schema change (making pl_namespace, tl_namespace and il_to indices UNIQUE).\n" );
+                       return false;
                }
 
-               $this->applyPatch( 'patch-pl-tl-il-unique.sql', false, "Making pl_namespace, tl_namespace and il_to indices UNIQUE" );
+               return $this->applyPatch( 'patch-pl-tl-il-unique.sql', false, "Making pl_namespace, tl_namespace and il_to indices UNIQUE" );
        }
 
        protected function renameEuWikiId() {
@@ -848,6 +857,9 @@ class MysqlUpdater extends DatabaseUpdater {
 
        protected function doUserNewTalkTimestampNotNull() {
                $info = $this->db->fieldInfo( 'user_newtalk', 'user_last_timestamp' );
+               if ( $info === false ) {
+                       return;
+               }
                if ( $info->isNullable() ) {
                        $this->output( "...user_last_timestamp is already nullable.\n" );
                        return;