Merge "Add dropSequence to postgres"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 14 Dec 2017 21:57:45 +0000 (21:57 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 14 Dec 2017 21:57:46 +0000 (21:57 +0000)
includes/installer/PostgresUpdater.php

index c38eb6a..393c2e1 100644 (file)
@@ -657,6 +657,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" );