From: Paladox Date: Wed, 19 Oct 2016 10:26:58 +0000 (+0100) Subject: Add dropSequence to postgres X-Git-Tag: 1.31.0-rc.0~1198^2 X-Git-Url: https://git.cyclocoop.org/%27.%24link.%27?a=commitdiff_plain;h=52fd34bc033f66404d47fdb3a744f94a478d0489;p=lhc%2Fweb%2Fwiklou.git Add dropSequence to postgres This is how to set it [ 'dropSequence', 'logging', 'logging_log_id_seq' ] for example Change-Id: I567287703310eff2e9e3cde8f2423dbf5e990a4b --- diff --git a/includes/installer/PostgresUpdater.php b/includes/installer/PostgresUpdater.php index 39cb89cd49..99569ea41d 100644 --- a/includes/installer/PostgresUpdater.php +++ b/includes/installer/PostgresUpdater.php @@ -626,6 +626,13 @@ END; } } + protected function dropSequence( $table, $ns ) { + if ( $this->db->sequenceExists( $ns ) ) { + $this->output( "Dropping sequence $ns\n" ); + $this->db->query( "DROP SEQUENCE $ns CASCADE" ); + } + } + protected function renameSequence( $old, $new ) { if ( $this->db->sequenceExists( $new ) ) { $this->output( "...sequence $new already exists.\n" );