From: Kevin Israel Date: Mon, 9 Jul 2018 15:28:59 +0000 (-0400) Subject: PostgreSQL: Drop three unused columns X-Git-Tag: 1.34.0-rc.0~3248^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/modifier.php?a=commitdiff_plain;h=ba1207d5d582f4ce9cb8a9c0cfe8f083fd9e366f;p=lhc%2Fweb%2Fwiklou.git PostgreSQL: Drop three unused columns The columns dropped in this commit are: * category.cat_hidden (for MySQL, dropped in 1.20 / 0cbc85494d47cdeb) * site_stats.ss_admins (for MySQL, dropped in 1.21 / bd602d20833f435f) * recentchanges.rc_cur_time (for MySQL, dropped in 1.24 / 2b441eba406f2c49) Bug: T64103 Change-Id: I7a7e9a2ac5066a9c9ab2583419d507e14fdd8c2c --- diff --git a/RELEASE-NOTES-1.32 b/RELEASE-NOTES-1.32 index cc250efb19..5f034b5ca3 100644 --- a/RELEASE-NOTES-1.32 +++ b/RELEASE-NOTES-1.32 @@ -662,6 +662,8 @@ because of Phabricator reports. should be mediated by the CommentStore class, this change shouldn't affect external code. * (T206147) Database::close() will no longer commit any open transactions. +* (T64103) Dropped columns category.cat_hidden, site_stats.ss_admins, and + recentchanges.rc_cur_time from the PostgreSQL schema. == Compatibility == MediaWiki 1.32 requires PHP 7.0.0 or later. Although HHVM 3.18.5 or later is diff --git a/includes/installer/PostgresUpdater.php b/includes/installer/PostgresUpdater.php index 917f589164..9ddc85a7b7 100644 --- a/includes/installer/PostgresUpdater.php +++ b/includes/installer/PostgresUpdater.php @@ -598,6 +598,9 @@ class PostgresUpdater extends DatabaseUpdater { [ 'addPgField', 'ipblocks', 'ipb_sitewide', 'SMALLINT NOT NULL DEFAULT 1' ], [ 'addTable', 'ipblocks_restrictions', 'patch-ipblocks_restrictions-table.sql' ], [ 'migrateImageCommentTemp' ], + [ 'dropPgField', 'category', 'cat_hidden' ], + [ 'dropPgField', 'site_stats', 'ss_admins' ], + [ 'dropPgField', 'recentchanges', 'rc_cur_time' ], // 1.33 [ 'dropField', 'change_tag', 'ct_tag', 'patch-drop-ct_tag.sql' ], @@ -953,8 +956,7 @@ END; protected function changeNullableField( $table, $field, $null, $update = false ) { $fi = $this->db->fieldInfo( $table, $field ); if ( is_null( $fi ) ) { - $this->output( "...ERROR: expected column $table.$field to exist\n" ); - exit( 1 ); + return; } if ( $fi->isNullable() ) { # # It's NULL - does it need to be NOT NULL? diff --git a/maintenance/postgres/tables.sql b/maintenance/postgres/tables.sql index 4f636ae664..02d018cb22 100644 --- a/maintenance/postgres/tables.sql +++ b/maintenance/postgres/tables.sql @@ -397,7 +397,6 @@ CREATE TABLE site_stats ( ss_total_pages INTEGER DEFAULT NULL, ss_users INTEGER DEFAULT NULL, ss_active_users INTEGER DEFAULT NULL, - ss_admins INTEGER DEFAULT NULL, ss_images INTEGER DEFAULT NULL ); @@ -556,7 +555,6 @@ CREATE SEQUENCE recentchanges_rc_id_seq; CREATE TABLE recentchanges ( rc_id INTEGER NOT NULL PRIMARY KEY DEFAULT nextval('recentchanges_rc_id_seq'), rc_timestamp TIMESTAMPTZ NOT NULL, - rc_cur_time TIMESTAMPTZ NULL, rc_user INTEGER NOT NULL DEFAULT 0 REFERENCES mwuser(user_id) ON DELETE SET NULL DEFERRABLE INITIALLY DEFERRED, rc_user_text TEXT NOT NULL DEFAULT '', rc_actor INTEGER NOT NULL DEFAULT 0, @@ -791,8 +789,7 @@ CREATE TABLE category ( cat_title TEXT NOT NULL, cat_pages INTEGER NOT NULL DEFAULT 0, cat_subcats INTEGER NOT NULL DEFAULT 0, - cat_files INTEGER NOT NULL DEFAULT 0, - cat_hidden SMALLINT NOT NULL DEFAULT 0 + cat_files INTEGER NOT NULL DEFAULT 0 ); ALTER SEQUENCE category_cat_id_seq OWNED BY category.cat_id; CREATE UNIQUE INDEX category_title ON category(cat_title);