From 14f74d141ab5580688bfd46d2f74c026e43ed967 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Wed, 1 Apr 2015 06:11:44 +0200 Subject: Update to MediaWiki 1.24.2 --- includes/installer/PostgresUpdater.php | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'includes/installer/PostgresUpdater.php') diff --git a/includes/installer/PostgresUpdater.php b/includes/installer/PostgresUpdater.php index 9e8ee94f..df2f0e32 100644 --- a/includes/installer/PostgresUpdater.php +++ b/includes/installer/PostgresUpdater.php @@ -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' ), @@ -418,6 +416,10 @@ class PostgresUpdater extends DatabaseUpdater { array( 'addPgField', 'pagelinks', 'pl_from_namespace', 'INTEGER NOT NULL DEFAULT 0' ), array( 'addPgField', 'templatelinks', 'tl_from_namespace', 'INTEGER NOT NULL DEFAULT 0' ), array( 'addPgField', 'imagelinks', 'il_from_namespace', 'INTEGER NOT NULL DEFAULT 0' ), + + // 1.24.1 (backport from 1.25) + array( 'dropFkey', 'recentchanges', 'rc_cur_id' ) + ); } @@ -769,6 +771,24 @@ END; } } + protected function dropFkey( $table, $field ) { + $fi = $this->db->fieldInfo( $table, $field ); + if ( is_null( $fi ) ) { + $this->output( "WARNING! Column '$table.$field' does not exist but it should! " . + "Please report this.\n" ); + return; + } + $conname = $fi->conname(); + if ( $fi->conname() ) { + $this->output( "Dropping foreign key constraint on '$table.$field'\n" ); + $conclause = "CONSTRAINT \"$conname\""; + $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" ); + }; + } + protected function changeFkeyDeferrable( $table, $field, $clause ) { $fi = $this->db->fieldInfo( $table, $field ); if ( is_null( $fi ) ) { -- cgit v1.2.2