PostgreSQL: Improve dropping of foreign key constraint
authorJeff Janes <jeff.janes@gmail.com>
Wed, 18 Feb 2015 05:22:40 +0000 (21:22 -0800)
committerJeff Janes <jeff.janes@gmail.com>
Wed, 18 Feb 2015 05:22:40 +0000 (21:22 -0800)
Change I2abd650c8ce83c5b725aec054 to fix bug T76254 was
inefficient upon subsequent updates, as update.php would
first add the constraint, and then remove it again.

Remove the older code responsible for adding the doomed
constraint.

Also, make the "do nothing" output message more consistent
with other messages of the same nature.

Change-Id: Id6a05c1234fbdc5849480d13fb7d6476eac52857

includes/installer/PostgresUpdater.php

index 9e41276..6ac5436 100644 (file)
@@ -384,8 +384,6 @@ class PostgresUpdater extends DatabaseUpdater {
                                'page(page_id) ON DELETE CASCADE' ),
                        array( 'changeFkeyDeferrable', 'protected_titles', 'pt_user',
                                'mwuser(user_id) ON DELETE SET NULL' ),
-                       array( 'changeFkeyDeferrable', 'recentchanges', 'rc_cur_id',
-                               'page(page_id) ON DELETE SET NULL' ),
                        array( 'changeFkeyDeferrable', 'recentchanges', 'rc_user',
                                'mwuser(user_id) ON DELETE SET NULL' ),
                        array( 'changeFkeyDeferrable', 'redirect', 'rd_from', 'page(page_id) ON DELETE CASCADE' ),
@@ -789,7 +787,7 @@ END;
                        $command = "ALTER TABLE $table DROP CONSTRAINT $conname";
                        $this->db->query( $command );
                } else {
-                       $this->output( "Foreign key constraint on '$table.$field' already does not exist\n" );
+                       $this->output( "...foreign key constraint on '$table.$field' already does not exist\n" );
                };
        }