X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Finstaller%2FPostgresUpdater.php;h=d0b16cb7fd7c615afe4225ce152ffd8a0ef28450;hb=e900893531e76fb8f80c1c9b5be459fd02862c3c;hp=31827a1ab7249466b5c44272c316caceacc4018b;hpb=c99b4bd4e646c3911a4d8b26dc77fa5c89ee7f91;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/installer/PostgresUpdater.php b/includes/installer/PostgresUpdater.php index 31827a1ab7..d0b16cb7fd 100644 --- a/includes/installer/PostgresUpdater.php +++ b/includes/installer/PostgresUpdater.php @@ -110,7 +110,7 @@ class PostgresUpdater extends DatabaseUpdater { [ 'addPgField', 'image', 'img_sha1', "TEXT NOT NULL DEFAULT ''" ], [ 'addPgField', 'ipblocks', 'ipb_allow_usertalk', 'SMALLINT NOT NULL DEFAULT 0' ], [ 'addPgField', 'ipblocks', 'ipb_anon_only', 'SMALLINT NOT NULL DEFAULT 0' ], - [ 'addPgField', 'ipblocks', 'ipb_by_text', "TEXT NOT NULL DEFAULT ''" ], + [ 'ifNoActorTable', 'addPgField', 'ipblocks', 'ipb_by_text', "TEXT NOT NULL DEFAULT ''" ], [ 'addPgField', 'ipblocks', 'ipb_block_email', 'SMALLINT NOT NULL DEFAULT 0' ], [ 'addPgField', 'ipblocks', 'ipb_create_account', 'SMALLINT NOT NULL DEFAULT 1' ], [ 'addPgField', 'ipblocks', 'ipb_deleted', 'SMALLINT NOT NULL DEFAULT 0' ], @@ -152,7 +152,7 @@ class PostgresUpdater extends DatabaseUpdater { [ 'addPgField', 'revision', 'rev_content_format', 'TEXT' ], [ 'addPgField', 'site_stats', 'ss_active_users', "INTEGER DEFAULT '-1'" ], [ 'addPgField', 'user_newtalk', 'user_last_timestamp', 'TIMESTAMPTZ' ], - [ 'addPgField', 'logging', 'log_user_text', "TEXT NOT NULL DEFAULT ''" ], + [ 'ifNoActorTable', 'addPgField', 'logging', 'log_user_text', "TEXT NOT NULL DEFAULT ''" ], [ 'addPgField', 'logging', 'log_page', 'INTEGER' ], [ 'addPgField', 'interwiki', 'iw_api', "TEXT NOT NULL DEFAULT ''" ], [ 'addPgField', 'interwiki', 'iw_wikiid', "TEXT NOT NULL DEFAULT ''" ], @@ -240,7 +240,7 @@ class PostgresUpdater extends DatabaseUpdater { [ 'checkOiDeleted' ], # New indexes - [ 'addPgIndex', 'archive', 'archive_user_text', '(ar_user_text)' ], + [ 'ifNoActorTable', 'addPgIndex', 'archive', 'archive_user_text', '(ar_user_text)' ], [ 'addPgIndex', 'image', 'img_sha1', '(img_sha1)' ], [ 'addPgIndex', 'ipblocks', 'ipb_parent_block_id', '(ipb_parent_block_id)' ], [ 'addPgIndex', 'oldimage', 'oi_sha1', '(oi_sha1)' ], @@ -253,7 +253,7 @@ class PostgresUpdater extends DatabaseUpdater { [ 'addPgIndex', 'watchlist', 'wl_user', '(wl_user)' ], [ 'addPgIndex', 'watchlist', 'wl_user_notificationtimestamp', '(wl_user, wl_notificationtimestamp)' ], - [ 'addPgIndex', 'logging', 'logging_user_type_time', + [ 'ifNoActorTable', 'addPgIndex', 'logging', 'logging_user_type_time', '(log_user, log_type, log_timestamp)' ], [ 'addPgIndex', 'logging', 'logging_page_id_time', '(log_page,log_timestamp)' ], [ 'addPgIndex', 'iwlinks', 'iwl_prefix_from_title', '(iwl_prefix, iwl_from, iwl_title)' ], @@ -263,9 +263,10 @@ class PostgresUpdater extends DatabaseUpdater { [ 'addPgIndex', 'job', 'job_cmd_token', '(job_cmd, job_token, job_random)' ], [ 'addPgIndex', 'job', 'job_cmd_token_id', '(job_cmd, job_token, job_id)' ], [ 'addPgIndex', 'filearchive', 'fa_sha1', '(fa_sha1)' ], - [ 'addPgIndex', 'logging', 'logging_user_text_type_time', + [ 'ifNoActorTable', 'addPgIndex', 'logging', 'logging_user_text_type_time', '(log_user_text, log_type, log_timestamp)' ], - [ 'addPgIndex', 'logging', 'logging_user_text_time', '(log_user_text, log_timestamp)' ], + [ 'ifNoActorTable', 'addPgIndex', 'logging', 'logging_user_text_time', + '(log_user_text, log_timestamp)' ], [ 'checkIndex', 'pagelink_unique', [ [ 'pl_from', 'int4_ops', 'btree', 0 ], @@ -363,30 +364,36 @@ class PostgresUpdater extends DatabaseUpdater { [ 'checkIwlPrefix' ], # All FK columns should be deferred - [ 'changeFkeyDeferrable', 'archive', 'ar_user', 'mwuser(user_id) ON DELETE SET NULL' ], + [ 'ifNoActorTable', 'changeFkeyDeferrable', 'archive', 'ar_user', + 'mwuser(user_id) ON DELETE SET NULL' ], [ 'changeFkeyDeferrable', 'categorylinks', 'cl_from', 'page(page_id) ON DELETE CASCADE' ], [ 'changeFkeyDeferrable', 'externallinks', 'el_from', 'page(page_id) ON DELETE CASCADE' ], [ 'changeFkeyDeferrable', 'filearchive', 'fa_deleted_user', 'mwuser(user_id) ON DELETE SET NULL' ], - [ 'changeFkeyDeferrable', 'filearchive', 'fa_user', 'mwuser(user_id) ON DELETE SET NULL' ], - [ 'changeFkeyDeferrable', 'image', 'img_user', 'mwuser(user_id) ON DELETE SET NULL' ], + [ 'ifNoActorTable', 'changeFkeyDeferrable', 'filearchive', 'fa_user', + 'mwuser(user_id) ON DELETE SET NULL' ], + [ 'ifNoActorTable', 'changeFkeyDeferrable', 'image', 'img_user', + 'mwuser(user_id) ON DELETE SET NULL' ], [ 'changeFkeyDeferrable', 'imagelinks', 'il_from', 'page(page_id) ON DELETE CASCADE' ], - [ 'changeFkeyDeferrable', 'ipblocks', 'ipb_by', 'mwuser(user_id) ON DELETE CASCADE' ], + [ 'ifNoActorTable', 'changeFkeyDeferrable', 'ipblocks', 'ipb_by', + 'mwuser(user_id) ON DELETE CASCADE' ], [ 'changeFkeyDeferrable', 'ipblocks', 'ipb_user', 'mwuser(user_id) ON DELETE SET NULL' ], [ 'changeFkeyDeferrable', 'ipblocks', 'ipb_parent_block_id', 'ipblocks(ipb_id) ON DELETE SET NULL' ], [ 'changeFkeyDeferrable', 'langlinks', 'll_from', 'page(page_id) ON DELETE CASCADE' ], - [ 'changeFkeyDeferrable', 'logging', 'log_user', 'mwuser(user_id) ON DELETE SET NULL' ], + [ 'ifNoActorTable', 'changeFkeyDeferrable', 'logging', 'log_user', + 'mwuser(user_id) ON DELETE SET NULL' ], [ 'changeFkeyDeferrable', 'oldimage', 'oi_name', 'image(img_name) ON DELETE CASCADE ON UPDATE CASCADE' ], - [ 'changeFkeyDeferrable', 'oldimage', 'oi_user', 'mwuser(user_id) ON DELETE SET NULL' ], + [ 'ifNoActorTable', 'changeFkeyDeferrable', 'oldimage', 'oi_user', + 'mwuser(user_id) ON DELETE SET NULL' ], [ 'changeFkeyDeferrable', 'pagelinks', 'pl_from', 'page(page_id) ON DELETE CASCADE' ], [ 'changeFkeyDeferrable', 'page_props', 'pp_page', 'page (page_id) ON DELETE CASCADE' ], [ 'changeFkeyDeferrable', 'page_restrictions', 'pr_page', 'page(page_id) ON DELETE CASCADE' ], [ 'changeFkeyDeferrable', 'protected_titles', 'pt_user', 'mwuser(user_id) ON DELETE SET NULL' ], - [ 'changeFkeyDeferrable', 'recentchanges', 'rc_user', + [ 'ifNoActorTable', 'changeFkeyDeferrable', 'recentchanges', 'rc_user', 'mwuser(user_id) ON DELETE SET NULL' ], [ 'changeFkeyDeferrable', 'redirect', 'rd_from', 'page(page_id) ON DELETE CASCADE' ], [ 'changeFkeyDeferrable', 'revision', 'rev_page', 'page (page_id) ON DELETE CASCADE' ], @@ -476,6 +483,11 @@ class PostgresUpdater extends DatabaseUpdater { [ 'changeNullableField', 'protected_titles', 'pt_reason', 'NOT NULL', true ], [ 'addPgField', 'protected_titles', 'pt_reason_id', 'INTEGER NOT NULL DEFAULT 0' ], [ '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' ], // This field was added in 1.31, but is put here so it can be used by 'migrateComments' [ 'addPgField', 'image', 'img_description_id', 'INTEGER NOT NULL DEFAULT 0' ], @@ -500,6 +512,7 @@ class PostgresUpdater extends DatabaseUpdater { [ 'addTable', 'slot_roles', 'patch-slot_roles-table.sql' ], [ 'migrateArchiveText' ], [ 'addTable', 'actor', 'patch-actor-table.sql' ], + [ 'addTable', 'revision_actor_temp', 'patch-revision_actor_temp-table.sql' ], [ 'setDefault', 'revision', 'rev_user', 0 ], [ 'setDefault', 'revision', 'rev_user_text', '' ], [ 'setDefault', 'archive', 'ar_user', 0 ], @@ -618,6 +631,34 @@ class PostgresUpdater extends DatabaseUpdater { [ 'dropDefault', 'logging', 'log_comment_id' ], [ 'dropPgField', 'protected_titles', 'pt_reason' ], [ 'dropDefault', 'protected_titles', 'pt_reason_id' ], + + // 1.34 + [ 'dropPgIndex', 'archive', 'archive_user_text' ], + [ 'dropPgField', 'archive', 'ar_user' ], + [ 'dropPgField', 'archive', 'ar_user_text' ], + [ 'dropDefault', 'archive', 'ar_actor' ], + [ 'dropPgField', 'ipblocks', 'ipb_by' ], + [ 'dropPgField', 'ipblocks', 'ipb_by_text' ], + [ 'dropDefault', 'ipblocks', 'ipb_by_actor' ], + [ 'dropPgField', 'image', 'img_user' ], + [ 'dropPgField', 'image', 'img_user_text' ], + [ 'dropDefault', 'image', 'img_actor' ], + [ 'dropPgField', 'oldimage', 'oi_user' ], + [ 'dropPgField', 'oldimage', 'oi_user_text' ], + [ 'dropDefault', 'oldimage', 'oi_actor' ], + [ 'dropPgField', 'filearchive', 'fa_user' ], + [ 'dropPgField', 'filearchive', 'fa_user_text' ], + [ 'dropDefault', 'filearchive', 'fa_actor' ], + [ 'dropPgField', 'recentchanges', 'rc_user' ], + [ 'dropPgField', 'recentchanges', 'rc_user_text' ], + [ 'dropDefault', 'recentchanges', 'rc_actor' ], + [ 'dropPgIndex', 'logging', 'logging_user_time' ], + [ 'dropPgIndex', 'logging', 'logging_user_type_time' ], + [ 'dropPgIndex', 'logging', 'logging_user_text_type_time' ], + [ 'dropPgIndex', 'logging', 'logging_user_text_time' ], + [ 'dropPgField', 'logging', 'log_user' ], + [ 'dropPgField', 'logging', 'log_user_text' ], + [ 'dropDefault', 'logging', 'log_actor' ], ]; }