Add dropTable method
authorSam Reed <reedy@users.mediawiki.org>
Thu, 27 Oct 2011 23:07:04 +0000 (23:07 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Thu, 27 Oct 2011 23:07:04 +0000 (23:07 +0000)
includes/installer/DatabaseUpdater.php

index 80dbe30..b21f694 100644 (file)
@@ -480,6 +480,21 @@ abstract class DatabaseUpdater {
                }
        }
 
+       /**
+        * @param $table string
+        * @param $patch string
+        * @param $fullpath bool
+        */
+       protected function dropTable( $table, $patch, $fullpath = false ) {
+               if ( $this->db->tableExists( $table ) ) {
+                       $this->output( "Dropping table $table... " );
+                       $this->applyPatch( $patch, $fullpath );
+                       $this->output( "ok\n" );
+               } else {
+                       $this->output( "...$table doesn't exist.\n" );
+               }
+       }
+
        /**
         * Modify an existing field
         *