From d18f8b76ec5b86120d4eb995dd71674c776a59f3 Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Thu, 27 Oct 2011 23:07:04 +0000 Subject: [PATCH] Add dropTable method --- includes/installer/DatabaseUpdater.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/includes/installer/DatabaseUpdater.php b/includes/installer/DatabaseUpdater.php index 80dbe30ac6..b21f69413a 100644 --- a/includes/installer/DatabaseUpdater.php +++ b/includes/installer/DatabaseUpdater.php @@ -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 * -- 2.20.1