From 4acdf1669d911d41b0fd4e79fd00a9b7dc66fe80 Mon Sep 17 00:00:00 2001 From: Amir Sarabadani Date: Sat, 10 Apr 2021 21:12:03 +0200 Subject: [PATCH] Final fixes of Postgres updater for REL1_36 Tested upgrade from 1.35 locally, and it broke due to two issues: - text table didn't exist, making renaming the table the first update. - the update was using user instead of mwuser. That was intentional on the grounds that it'll be fixed soon, but it seems I746714f7b3a is not going to make to the release. Bug: T164898 Change-Id: I0c152f339954a001c5a5a0b94b8ad48e5b077290 --- includes/installer/PostgresUpdater.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/includes/installer/PostgresUpdater.php b/includes/installer/PostgresUpdater.php index 2549f1cc5de..55522c278b8 100644 --- a/includes/installer/PostgresUpdater.php +++ b/includes/installer/PostgresUpdater.php @@ -41,6 +41,10 @@ class PostgresUpdater extends DatabaseUpdater { */ protected function getCoreUpdateList() { return [ + // Exception to the sequential updates. Renaming pagecontent to text table. + // Introduced in 1.36. + [ 'renameTable', 'pagecontent', 'text' ], + // 1.28 [ 'addPgIndex', 'recentchanges', 'rc_name_type_patrolled_timestamp', '( rc_namespace, rc_type, rc_patrolled, rc_timestamp )' ], @@ -520,7 +524,6 @@ class PostgresUpdater extends DatabaseUpdater { [ 'addPgIndex', 'filearchive', 'fa_actor_timestamp', '(fa_actor, fa_timestamp)' ], [ 'addPgIndex', 'ipblocks', 'ipb_expiry', '(ipb_expiry)' ], [ 'addPgIndex', 'ipblocks', 'ipb_timestamp', '(ipb_timestamp)' ], - [ 'renameTable', 'pagecontent', 'text' ], [ 'renameIndex', 'text', 'pagecontent_pkey', 'text_pkey' ], [ 'changeNullableField', 'text', 'old_text', 'NOT NULL', true ], [ 'changeNullableField', 'text', 'old_flags', 'NOT NULL', true ], @@ -605,7 +608,7 @@ class PostgresUpdater extends DatabaseUpdater { [ 'renameIndex', 'revision', 'revision_unique', 'rev_page_id' ], [ 'renameIndex', 'revision', 'rev_timestamp_idx', 'rev_timestamp' ], [ 'addPgIndex', 'revision', 'rev_page_timestamp', '(rev_page,rev_timestamp)' ], - [ 'changeNullableField', 'user', 'user_touched', 'NOT NULL', true ], + [ 'changeNullableField', 'mwuser', 'user_touched', 'NOT NULL', true ], ]; }