updater: Move rev_sha1 addition before convertUserOptions
authorDavid Mudrák <david@moodle.com>
Mon, 29 Jul 2013 13:09:25 +0000 (15:09 +0200)
committerMatmarex <matma.rex@gmail.com>
Mon, 29 Jul 2013 13:25:39 +0000 (13:25 +0000)
Execution of the script and addition of rev_sha1 are both 1.19
activities, but for some reason the issue has only shown up in 1.21.

* MysqlUpdater::getCoreUpdateList() declares that 'doMigrateUserOptions'
  should be executed before adding the field rev_sha1 into the revision table
* ConvertUserOptions::execute() calls User::saveSettings()
* User::saveSettings() at its very end calls $this->getUserPage()->invalidateCache()
  and that is where the revision query is joining the party.

Bug: 48820
Change-Id: Id0a6efc33a8c46fdc3e9c294aa2d005d46c7dda0

includes/installer/MysqlUpdater.php

index 1c22afb..02faf7c 100644 (file)
@@ -195,9 +195,9 @@ class MysqlUpdater extends DatabaseUpdater {
 
                        // 1.19
                        array( 'addIndex', 'logging',       'type_action',      'patch-logging-type-action-index.sql'),
+                       array( 'addField', 'revision',      'rev_sha1',         'patch-rev_sha1.sql' ),
                        array( 'doMigrateUserOptions' ),
                        array( 'dropField', 'user',         'user_options', 'patch-drop-user_options.sql' ),
-                       array( 'addField', 'revision',      'rev_sha1',         'patch-rev_sha1.sql' ),
                        array( 'addField', 'archive',       'ar_sha1',          'patch-ar_sha1.sql' ),
                        array( 'addIndex', 'page', 'page_redirect_namespace_len', 'patch-page_redirect_namespace_len.sql' ),
                        array( 'addField',      'uploadstash',  'us_chunk_inx',         'patch-uploadstash_chunk.sql' ),