X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Finstaller%2FMysqlUpdater.php;h=f0519c7a0309eb39f1d16c65f7c3ab361047756e;hp=0d516b48fe38e5c7ebe21f05683ec9ae5fd2e50e;hb=825d66bfa44c5dae2b78e2fe4f3b16f16aff4a12;hpb=e3e33ce99c909103b4b2b861c8361729441eccc8 diff --git a/includes/installer/MysqlUpdater.php b/includes/installer/MysqlUpdater.php index 0d516b48fe..f0519c7a03 100644 --- a/includes/installer/MysqlUpdater.php +++ b/includes/installer/MysqlUpdater.php @@ -29,7 +29,7 @@ use MediaWiki\MediaWikiServices; * * @ingroup Deployment * @since 1.17 - * @property DatabaseMysqlBase $db + * @property Wikimedia\Rdbms\DatabaseMysqlBase $db */ class MysqlUpdater extends DatabaseUpdater { protected function getCoreUpdateList() { @@ -101,8 +101,10 @@ class MysqlUpdater extends DatabaseUpdater { [ 'addTable', 'querycache_info', 'patch-querycacheinfo.sql' ], [ 'addTable', 'filearchive', 'patch-filearchive.sql' ], [ 'addField', 'ipblocks', 'ipb_anon_only', 'patch-ipb_anon_only.sql' ], - [ 'addIndex', 'recentchanges', 'rc_ns_usertext', 'patch-recentchanges-utindex.sql' ], - [ 'addIndex', 'recentchanges', 'rc_user_text', 'patch-rc_user_text-index.sql' ], + [ 'ifNoActorTable', 'addIndex', 'recentchanges', 'rc_ns_usertext', + 'patch-recentchanges-utindex.sql' ], + [ 'ifNoActorTable', 'addIndex', 'recentchanges', 'rc_user_text', + 'patch-rc_user_text-index.sql' ], // 1.9 [ 'addField', 'user', 'user_newpass_time', 'patch-user_newpass_time.sql' ], @@ -130,9 +132,12 @@ class MysqlUpdater extends DatabaseUpdater { [ 'addField', 'ipblocks', 'ipb_block_email', 'patch-ipb_emailban.sql' ], [ 'doCategorylinksIndicesUpdate' ], [ 'addField', 'oldimage', 'oi_metadata', 'patch-oi_metadata.sql' ], - [ 'addIndex', 'archive', 'usertext_timestamp', 'patch-archive-user-index.sql' ], - [ 'addIndex', 'image', 'img_usertext_timestamp', 'patch-image-user-index.sql' ], - [ 'addIndex', 'oldimage', 'oi_usertext_timestamp', 'patch-oldimage-user-index.sql' ], + [ 'ifNoActorTable', 'addIndex', 'archive', 'usertext_timestamp', + 'patch-archive-user-index.sql' ], + [ 'ifNoActorTable', 'addIndex', 'image', 'img_usertext_timestamp', + 'patch-image-user-index.sql' ], + [ 'ifNoActorTable', 'addIndex', 'oldimage', 'oi_usertext_timestamp', + 'patch-oldimage-user-index.sql' ], [ 'addField', 'archive', 'ar_page_id', 'patch-archive-page_id.sql' ], [ 'addField', 'image', 'img_sha1', 'patch-img_sha1.sql' ], @@ -140,7 +145,7 @@ class MysqlUpdater extends DatabaseUpdater { [ 'addTable', 'protected_titles', 'patch-protected_titles.sql' ], // 1.13 - [ 'addField', 'ipblocks', 'ipb_by_text', 'patch-ipb_by_text.sql' ], + [ 'ifNoActorTable', 'addField', 'ipblocks', 'ipb_by_text', 'patch-ipb_by_text.sql' ], [ 'addTable', 'page_props', 'patch-page_props.sql' ], [ 'addTable', 'updatelog', 'patch-updatelog.sql' ], [ 'addTable', 'category', 'patch-category.sql' ], @@ -150,7 +155,7 @@ class MysqlUpdater extends DatabaseUpdater { [ 'doPopulateParentId' ], [ 'checkBin', 'protected_titles', 'pt_title', 'patch-pt_title-encoding.sql', ], [ 'doMaybeProfilingMemoryUpdate' ], - [ 'doFilearchiveIndicesUpdate' ], + [ 'ifNoActorTable', 'doFilearchiveIndicesUpdate' ], // 1.14 [ 'addField', 'site_stats', 'ss_active_users', 'patch-ss_active_users.sql' ], @@ -163,9 +168,9 @@ class MysqlUpdater extends DatabaseUpdater { // 1.16 [ 'addTable', 'user_properties', 'patch-user_properties.sql' ], [ 'addTable', 'log_search', 'patch-log_search.sql' ], - [ 'addField', 'logging', 'log_user_text', 'patch-log_user_text.sql' ], + [ 'ifNoActorTable', 'addField', 'logging', 'log_user_text', 'patch-log_user_text.sql' ], # listed separately from the previous update because 1.16 was released without this update - [ 'doLogUsertextPopulation' ], + [ 'ifNoActorTable', 'doLogUsertextPopulation' ], [ 'doLogSearchPopulation' ], [ 'addTable', 'l10n_cache', 'patch-l10n_cache.sql' ], [ 'dropIndex', 'change_tag', 'ct_rc_id', 'patch-change_tag-indexes.sql' ], @@ -240,9 +245,10 @@ class MysqlUpdater extends DatabaseUpdater { // 1.23 [ 'addField', 'recentchanges', 'rc_source', 'patch-rc_source.sql' ], - [ 'addIndex', 'logging', 'log_user_text_type_time', + [ 'ifNoActorTable', 'addIndex', 'logging', 'log_user_text_type_time', 'patch-logging_user_text_type_time_index.sql' ], - [ 'addIndex', 'logging', 'log_user_text_time', 'patch-logging_user_text_time_index.sql' ], + [ 'ifNoActorTable', 'addIndex', 'logging', 'log_user_text_time', + 'patch-logging_user_text_time_index.sql' ], [ 'addField', 'page', 'page_links_updated', 'patch-page_links_updated.sql' ], [ 'addField', 'user', 'user_password_expires', 'patch-user_password_expire.sql' ], @@ -288,13 +294,14 @@ class MysqlUpdater extends DatabaseUpdater { [ 'doNonUniquePlTlIl' ], [ 'addField', 'change_tag', 'ct_id', 'patch-change_tag-ct_id.sql' ], [ 'modifyField', 'recentchanges', 'rc_ip', 'patch-rc_ip_modify.sql' ], - [ 'addIndex', 'archive', 'usertext_timestamp', 'patch-rename-ar_usertext_timestamp.sql' ], + [ 'ifNoActorTable', 'addIndex', 'archive', 'usertext_timestamp', + 'patch-rename-ar_usertext_timestamp.sql' ], // 1.29 [ 'addField', 'externallinks', 'el_index_60', 'patch-externallinks-el_index_60.sql' ], [ 'dropIndex', 'user_groups', 'ug_user_group', 'patch-user_groups-primary-key.sql' ], [ 'addField', 'user_groups', 'ug_expiry', 'patch-user_groups-ug_expiry.sql' ], - [ 'addIndex', 'image', 'img_user_timestamp', 'patch-image-user-index-2.sql' ], + [ 'ifNoActorTable', 'addIndex', 'image', 'img_user_timestamp', 'patch-image-user-index-2.sql' ], // 1.30 [ 'modifyField', 'image', 'img_media_type', 'patch-add-3d.sql' ], @@ -320,6 +327,20 @@ 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' ], + [ 'addTable', 'revision_comment_temp', 'patch-revision_comment_temp-table.sql' ], + // image_comment_temp is no longer needed when upgrading to MW 1.31 or newer, + // as it is dropped later in the update process as part of 'migrateImageCommentTemp'. + // File kept on disk and the updater entry here for historical purposes. + // [ 'addTable', 'image_comment_temp', 'patch-image_comment_temp-table.sql' ], + [ 'addField', 'archive', 'ar_comment_id', 'patch-archive-ar_comment_id.sql' ], + [ 'addField', 'filearchive', 'fa_description_id', 'patch-filearchive-fa_description_id.sql' ], + [ 'modifyField', 'image', 'img_description', 'patch-image-img_description-default..sql' ], + [ 'addField', 'ipblocks', 'ipb_reason_id', 'patch-ipblocks-ipb_reason_id.sql' ], + [ 'addField', 'logging', 'log_comment_id', 'patch-logging-log_comment_id.sql' ], + [ 'addField', 'oldimage', 'oi_description_id', 'patch-oldimage-oi_description_id.sql' ], + [ 'addField', 'protected_titles', 'pt_reason_id', 'patch-protected_titles-pt_reason_id.sql' ], + [ 'addField', 'recentchanges', 'rc_comment_id', 'patch-recentchanges-rc_comment_id.sql' ], + [ 'modifyField', 'revision', 'rev_comment', 'patch-revision-rev_comment-default.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' ], @@ -377,6 +398,13 @@ class MysqlUpdater extends DatabaseUpdater { [ 'dropTable', 'tag_summary' ], [ 'dropField', 'protected_titles', 'pt_reason', 'patch-drop-comment-fields.sql' ], [ 'modifyTable', 'job', 'patch-job-params-mediumblob.sql' ], + + // 1.34 + [ 'dropIndex', 'archive', 'ar_usertext_timestamp', + 'patch-drop-archive-ar_usertext_timestamp.sql' ], + [ 'dropIndex', 'archive', 'usertext_timestamp', 'patch-drop-archive-usertext_timestamp.sql' ], + [ 'dropField', 'logging', 'log_user', 'patch-drop-user-fields.sql' ], + [ 'addIndex', 'user_newtalk', 'un_user_ip', 'patch-rename-mysql-user_newtalk-indexes.sql' ], ]; }