Kill the updater remnants from r98467
[lhc/web/wiklou.git] / includes / installer / MysqlUpdater.php
index 03d9197..cd6de36 100644 (file)
@@ -147,8 +147,9 @@ class MysqlUpdater extends DatabaseUpdater {
                        // 1.16
                        array( 'addTable', 'user_properties',                   'patch-user_properties.sql' ),
                        array( 'addTable', 'log_search',                        'patch-log_search.sql' ),
-                       array( 'doLogSearchPopulation' ),
                        array( 'addField', 'logging',       'log_user_text',    'patch-log_user_text.sql' ),
+                       array( 'doLogUsertextPopulation' ), # listed separately from the previous update because 1.16 was released without this update
+                       array( 'doLogSearchPopulation' ),
                        array( 'addTable', 'l10n_cache',                        'patch-l10n_cache.sql' ),
                        array( 'addTable', 'external_user',                     'patch-external_user.sql' ),
                        array( 'addIndex', 'log_search',    'ls_field_val',     'patch-log_search-rename-index.sql' ),
@@ -157,23 +158,36 @@ class MysqlUpdater extends DatabaseUpdater {
                        array( 'doUpdateTranscacheField' ),
                        array( 'renameEuWikiId' ),
                        array( 'doUpdateMimeMinorField' ),
-                       array( 'doPopulateRevLen' ),
 
                        // 1.17
                        array( 'addTable', 'iwlinks',                           'patch-iwlinks.sql' ),
                        array( 'addIndex', 'iwlinks', 'iwl_prefix_title_from',  'patch-rename-iwl_prefix.sql' ),
-                       array( 'addField', 'updatelog', 'ul_value',              'patch-ul_value.sql' ),
+                       array( 'addField', 'updatelog',     'ul_value',         'patch-ul_value.sql' ),
                        array( 'addField', 'interwiki',     'iw_api',           'patch-iw_api_and_wikiid.sql' ),
-                       array( 'dropIndex', 'iwlinks', 'iwl_prefix',  'patch-kill-iwl_prefix.sql' ),
-                       array( 'dropIndex', 'iwlinks', 'iwl_prefix_from_title', 'patch-kill-iwl_pft.sql' ),
-                       array( 'addField', 'categorylinks', 'cl_collation', 'patch-categorylinks-better-collation.sql' ),
+                       array( 'dropIndex', 'iwlinks',      'iwl_prefix',       'patch-kill-iwl_prefix.sql' ),
+                       array( 'dropIndex', 'iwlinks',      'iwl_prefix_from_title', 'patch-kill-iwl_pft.sql' ),
+                       array( 'addField', 'categorylinks', 'cl_collation',     'patch-categorylinks-better-collation.sql' ),
                        array( 'doClFieldsUpdate' ),
                        array( 'doCollationUpdate' ),
                        array( 'addTable', 'msg_resource',                      'patch-msg_resource.sql' ),
                        array( 'addTable', 'module_deps',                       'patch-module_deps.sql' ),
-                       array( 'dropIndex', 'archive', 'ar_page_revid',         'patch-archive_kill_ar_page_revid.sql' ),
-                       array( 'addIndex', 'archive', 'ar_revid',               'patch-archive_ar_revid.sql' ),
+                       array( 'dropIndex', 'archive',      'ar_page_revid',    'patch-archive_kill_ar_page_revid.sql' ),
+                       array( 'addIndex', 'archive',       'ar_revid',         'patch-archive_ar_revid.sql' ),
                        array( 'doLangLinksLengthUpdate' ),
+
+                       // 1.18
+                       array( 'doUserNewTalkTimestampNotNull' ),
+                       array( 'addIndex', 'user',          'user_email',       'patch-user_email_index.sql' ),
+                       array( 'modifyField', 'user_properties', 'up_property', 'patch-up_property.sql' ),
+                       array( 'addTable', 'uploadstash',                       'patch-uploadstash.sql' ),
+                       array( 'addTable', 'user_former_groups',                'patch-user_former_groups.sql'),
+
+                       // 1.19
+                       array( 'addTable', 'config',                            'patch-config.sql' ),
+                       array( 'addIndex', 'logging',       'type_action',      'patch-logging-type-action-index.sql'),
+                       array( 'doMigrateUserOptions' ),
+                       array( 'dropField', 'user',         'user_options', 'patch-drop-user_options.sql' ),
+
                );
        }
 
@@ -195,7 +209,7 @@ class MysqlUpdater extends DatabaseUpdater {
                } else {
                        $this->output( "Fixing $field encoding on $table table... " );
                        $this->applyPatch( $patchFile );
-                       $this->output( "ok\n" );
+                       $this->output( "done.\n" );
                }
        }
 
@@ -237,7 +251,7 @@ class MysqlUpdater extends DatabaseUpdater {
                $this->output( "ok\n" );
                $this->output( 'Adding default interwiki definitions...' );
                $this->applyPatch( "$IP/maintenance/interwiki.sql", true );
-               $this->output( "ok\n" );
+               $this->output( "done.\n" );
        }
 
        /**
@@ -245,6 +259,9 @@ class MysqlUpdater extends DatabaseUpdater {
         */
        protected function doIndexUpdate() {
                $meta = $this->db->fieldInfo( 'recentchanges', 'rc_timestamp' );
+               if ( $meta === false ) {
+                       throw new MWException( 'Missing rc_timestamp field of recentchanges table. Should not happen.' );
+               }
                if ( $meta->isMultipleKey() ) {
                        $this->output( "...indexes seem up to 20031107 standards\n" );
                        return;
@@ -252,7 +269,7 @@ class MysqlUpdater extends DatabaseUpdater {
 
                $this->output( "Updating indexes to 20031107..." );
                $this->applyPatch( 'patch-indexes.sql', true );
-               $this->output( "ok\n" );
+               $this->output( "done.\n" );
        }
 
        protected function doOldLinksUpdate() {
@@ -270,7 +287,7 @@ class MysqlUpdater extends DatabaseUpdater {
                $this->output( "Fixing ancient broken imagelinks table.\n" );
                $this->output( "NOTE: you will have to run maintenance/refreshLinks.php after this.\n" );
                $this->applyPatch( 'patch-fix-il_from.sql' );
-               $this->output( "ok\n" );
+               $this->output( "done.\n" );
        }
 
        /**
@@ -292,7 +309,7 @@ class MysqlUpdater extends DatabaseUpdater {
                                'wl_title' => 'wl_title',
                                'wl_notificationtimestamp' => 'wl_notificationtimestamp'
                        ), array( 'NOT (wl_namespace & 1)' ), __METHOD__, 'IGNORE' );
-               $this->output( "ok\n" );
+               $this->output( "done.\n" );
        }
 
        function doSchemaRestructuring() {
@@ -481,7 +498,7 @@ class MysqlUpdater extends DatabaseUpdater {
                        } else {
                                $this->output( "Promoting $field from $info->Type to int... " );
                                $this->db->query( "ALTER TABLE $tablename MODIFY $field int NOT NULL", __METHOD__ );
-                               $this->output( "ok\n" );
+                               $this->output( "done.\n" );
                        }
                }
        }
@@ -494,7 +511,7 @@ class MysqlUpdater extends DatabaseUpdater {
 
                $this->output( "Converting links and brokenlinks tables to pagelinks... " );
                $this->applyPatch( 'patch-pagelinks.sql' );
-               $this->output( "ok\n" );
+               $this->output( "done.\n" );
 
                global $wgContLang;
                foreach ( MWNamespace::getCanonicalNamespaces() as $ns => $name ) {
@@ -516,7 +533,7 @@ class MysqlUpdater extends DatabaseUpdater {
                                           AND pl_title LIKE '$likeprefix:%'";
 
                        $this->db->query( $sql, __METHOD__ );
-                       $this->output( "ok\n" );
+                       $this->output( "done.\n" );
                }
        }
 
@@ -532,7 +549,7 @@ class MysqlUpdater extends DatabaseUpdater {
                }
                $this->output( "Adding unique index on user_name... " );
                $this->applyPatch( 'patch-user_nameindex.sql' );
-               $this->output( "ok\n" );
+               $this->output( "done.\n" );
        }
 
        protected function doUserGroupsUpdate() {
@@ -595,7 +612,7 @@ class MysqlUpdater extends DatabaseUpdater {
                                        __METHOD__ );
                        }
                }
-               $this->output( "ok\n" );
+               $this->output( "done.\n" );
        }
 
        /**
@@ -611,7 +628,7 @@ class MysqlUpdater extends DatabaseUpdater {
 
                $this->output( "Making wl_notificationtimestamp nullable... " );
                $this->applyPatch( 'patch-watchlist-null.sql' );
-               $this->output( "ok\n" );
+               $this->output( "done.\n" );
        }
 
        /**
@@ -648,7 +665,7 @@ class MysqlUpdater extends DatabaseUpdater {
                        foreach ( $res as $row ) {
                                $count = ( $count + 1 ) % 100;
                                if ( $count == 0 ) {
-                                       wfWaitForSlaves( 10 );
+                                       wfWaitForSlaves();
                                }
                                $this->db->insert( 'templatelinks',
                                        array(
@@ -698,7 +715,7 @@ class MysqlUpdater extends DatabaseUpdater {
                $this->output( "Creating page_restrictions table..." );
                $this->applyPatch( 'patch-page_restrictions.sql' );
                $this->applyPatch( 'patch-page_restrictions_sortkey.sql' );
-               $this->output( "ok\n" );
+               $this->output( "done.\n" );
 
                $this->output( "Migrating old restrictions to new table...\n" );
                $task = $this->maintenance->runChild( 'UpdateRestrictions' );
@@ -730,11 +747,12 @@ class MysqlUpdater extends DatabaseUpdater {
        }
 
        protected function doPopulateParentId() {
-               if ( $this->updateRowExists( 'populate rev_parent_id' ) ) {
-                       $this->output( "...rev_parent_id column already populated.\n" );
-                       return;
+               if ( !$this->updateRowExists( 'populate rev_parent_id' ) ) {
+                       $this->output(
+                               "Populating rev_parent_id fields, printing progress markers. For large\n" .
+                               "databases, you may want to hit Ctrl-C and do this manually with\n" .
+                               "maintenance/populateParentId.php.\n" );
                }
-
                $task = $this->maintenance->runChild( 'PopulateParentId' );
                $task->execute();
        }
@@ -747,15 +765,16 @@ class MysqlUpdater extends DatabaseUpdater {
                } else {
                        $this->output( "Adding pf_memory field to table profiling..." );
                        $this->applyPatch( 'patch-profiling-memory.sql' );
-                       $this->output( "ok\n" );
+                       $this->output( "done.\n" );
                }
        }
 
        protected function doFilearchiveIndicesUpdate() {
                $info = $this->db->indexInfo( 'filearchive', 'fa_user_timestamp', __METHOD__ );
                if ( !$info ) {
+                       $this->output( "Updating filearchive indices..." );
                        $this->applyPatch( 'patch-filearchive-user-index.sql' );
-                       $this->output( "...filearchive indices updated\n" );
+                       $this->output( "done.\n" );
                }
        }
 
@@ -768,7 +787,7 @@ class MysqlUpdater extends DatabaseUpdater {
 
                $this->output( "Making pl_namespace, tl_namespace and il_to indices UNIQUE... " );
                $this->applyPatch( 'patch-pl-tl-il-unique.sql' );
-               $this->output( "ok\n" );
+               $this->output( "done.\n" );
        }
 
        protected function renameEuWikiId() {
@@ -779,7 +798,7 @@ class MysqlUpdater extends DatabaseUpdater {
 
                $this->output( "Renaming eu_wiki_id -> eu_local_id... " );
                $this->applyPatch( 'patch-eu_local_id.sql' );
-               $this->output( "ok\n" );
+               $this->output( "done.\n" );
        }
 
        protected function doUpdateMimeMinorField() {
@@ -790,17 +809,7 @@ class MysqlUpdater extends DatabaseUpdater {
 
                $this->output( "Altering all *_mime_minor fields to 100 bytes in size ... " );
                $this->applyPatch( 'patch-mime_minor_length.sql' );
-               $this->output( "ok\n" );
-       }
-
-       protected function doPopulateRevLen() {
-               if ( $this->updateRowExists( 'populate rev_len' ) ) {
-                       $this->output( "...rev_len column already populated.\n" );
-                       return;
-               }
-
-               $task = $this->maintenance->runChild( 'PopulateRevisionLength' );
-               $task->execute();
+               $this->output( "done.\n" );
        }
 
        protected function doClFieldsUpdate() {
@@ -827,4 +836,16 @@ class MysqlUpdater extends DatabaseUpdater {
                        $this->output( "...ll_lang is up-to-date.\n" );
                }
        }
+
+       protected function doUserNewTalkTimestampNotNull() {
+               $info = $this->db->fieldInfo( 'user_newtalk', 'user_last_timestamp' );
+               if ( $info->isNullable() ) {
+                       $this->output( "...user_last_timestamp is already nullable.\n" );
+                       return;
+               }
+
+               $this->output( "Making user_last_timestamp nullable... " );
+               $this->applyPatch( 'patch-user-newtalk-timestamp-null.sql' );
+               $this->output( "done.\n" );
+       }
 }