Add dropSequence to postgres
authorPaladox <thomasmulhall410@yahoo.com>
Wed, 19 Oct 2016 10:26:58 +0000 (11:26 +0100)
committerPaladox <thomasmulhall410@yahoo.com>
Fri, 9 Jun 2017 19:55:30 +0000 (19:55 +0000)
This is how to set it

[ 'dropSequence', 'logging', 'logging_log_id_seq' ]

for example

Change-Id: I567287703310eff2e9e3cde8f2423dbf5e990a4b

includes/installer/PostgresUpdater.php

index 39cb89c..99569ea 100644 (file)
@@ -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" );