PostgreSQL: Drop three unused columns
authorKevin Israel <pleasestand@live.com>
Mon, 9 Jul 2018 15:28:59 +0000 (11:28 -0400)
committerBrad Jorsch <bjorsch@wikimedia.org>
Fri, 14 Dec 2018 18:01:48 +0000 (13:01 -0500)
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

RELEASE-NOTES-1.32
includes/installer/PostgresUpdater.php
maintenance/postgres/tables.sql

index cc250ef..5f034b5 100644 (file)
@@ -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
index 917f589..9ddc85a 100644 (file)
@@ -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?
index 4f636ae..02d018c 100644 (file)
@@ -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);