X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Finstaller%2FPostgresUpdater.php;h=9e412765cc1a07a8916d254705d9ac79e76daf35;hb=68aab7ca8bd2bf7271a2f69aff1e7a60ab88078b;hp=3b1c579d00dd8df3fb3967d70a7bf0b0ff069472;hpb=5f8edb2c0a24b88b84f66b851b63a01b36b1a12c;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/installer/PostgresUpdater.php b/includes/installer/PostgresUpdater.php index 3b1c579d00..9e412765cc 100644 --- a/includes/installer/PostgresUpdater.php +++ b/includes/installer/PostgresUpdater.php @@ -418,9 +418,12 @@ 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.25 array( 'dropTable', 'hitcounter' ), array( 'dropField', 'site_stats', 'ss_total_views', 'patch-drop-ss_total_views.sql' ), array( 'dropField', 'page', 'page_counter', 'patch-drop-page_counter.sql' ), + array( 'dropFkey', 'recentchanges', 'rc_cur_id' ) ); } @@ -772,6 +775,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 ) ) {