X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Finstaller%2FMysqlUpdater.php;h=60bb69fdeb305c1a9d2fa6c6ed6175dbf35af6c0;hb=e2f61aa44095d56af0d4b25a59e25b55a6c297bc;hp=350962fd1ed695a2d5d3ce05b28106585f42c898;hpb=0ded00ab4c6dc1ad4e961412d357080a0a5a056d;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/installer/MysqlUpdater.php b/includes/installer/MysqlUpdater.php index 350962fd1e..60bb69fdeb 100644 --- a/includes/installer/MysqlUpdater.php +++ b/includes/installer/MysqlUpdater.php @@ -325,6 +325,10 @@ class MysqlUpdater extends DatabaseUpdater { [ 'renameIndex', 'user_properties', 'user_properties_user_property', 'PRIMARY', false, 'patch-user_properties-fix-pk.sql' ], [ 'addTable', 'comment', 'patch-comment-table.sql' ], + + // This field was added in 1.31, but is put here so it can be used by 'migrateComments' + [ 'addField', 'image', 'img_description_id', 'patch-image-img_description_id.sql' ], + [ 'migrateComments' ], [ 'renameIndex', 'l10n_cache', 'lc_lang_key', 'PRIMARY', false, 'patch-l10n_cache-primary-key.sql' ], @@ -332,12 +336,18 @@ class MysqlUpdater extends DatabaseUpdater { // 1.31 [ 'addTable', 'slots', 'patch-slots.sql' ], + [ 'addField', 'slots', 'slot_origin', 'patch-slot-origin.sql' ], [ 'addTable', 'content', 'patch-content.sql' ], [ 'addTable', 'slot_roles', 'patch-slot_roles.sql' ], [ 'addTable', 'content_models', 'patch-content_models.sql' ], [ 'migrateArchiveText' ], [ 'addTable', 'actor', 'patch-actor-table.sql' ], [ 'migrateActors' ], + [ 'modifyField', 'revision', 'rev_text_id', 'patch-rev_text_id-default.sql' ], + [ 'modifyTable', 'site_stats', 'patch-site_stats-modify.sql' ], + [ 'populateArchiveRevId' ], + [ 'addIndex', 'recentchanges', 'rc_namespace_title_timestamp', + 'patch-recentchanges-nttindex.sql' ], ]; } @@ -474,6 +484,17 @@ class MysqlUpdater extends DatabaseUpdater { return; } + $insertOpts = [ 'IGNORE' ]; + $selectOpts = []; + + // If wl_id exists, make insertSelect() more replication-safe by + // ordering on that column. If not, hint that it should be safe anyway. + if ( $this->db->fieldExists( 'watchlist', 'wl_id', __METHOD__ ) ) { + $selectOpts['ORDER BY'] = 'wl_id'; + } else { + $insertOpts[] = 'NO_AUTO_COLUMNS'; + } + $this->output( "Adding missing watchlist talk page rows... " ); $this->db->insertSelect( 'watchlist', 'watchlist', [ @@ -481,7 +502,7 @@ class MysqlUpdater extends DatabaseUpdater { 'wl_namespace' => 'wl_namespace | 1', 'wl_title' => 'wl_title', 'wl_notificationtimestamp' => 'wl_notificationtimestamp' - ], [ 'NOT (wl_namespace & 1)' ], __METHOD__, 'IGNORE' ); + ], [ 'NOT (wl_namespace & 1)' ], __METHOD__, $insertOpts, $selectOpts ); $this->output( "done.\n" ); $this->output( "Adding missing watchlist subject page rows... " ); @@ -491,7 +512,7 @@ class MysqlUpdater extends DatabaseUpdater { 'wl_namespace' => 'wl_namespace & ~1', 'wl_title' => 'wl_title', 'wl_notificationtimestamp' => 'wl_notificationtimestamp' - ], [ 'wl_namespace & 1' ], __METHOD__, 'IGNORE' ); + ], [ 'wl_namespace & 1' ], __METHOD__, $insertOpts, $selectOpts ); $this->output( "done.\n" ); } @@ -903,7 +924,8 @@ class MysqlUpdater extends DatabaseUpdater { 'tl_title' => 'pl_title' ], [ 'pl_namespace' => 10 - ], __METHOD__ + ], __METHOD__, + [ 'NO_AUTO_COLUMNS' ] // There's no "tl_id" auto-increment field ); } $this->output( "Done. Please run maintenance/refreshLinks.php for a more " .