/** * Cleanup the database. * * @param array $tables Tables to remove. * * @return $this * * @since 1.0 */ private function cleanDatabase(array $tables) { $this->app->out('Removing existing tables...', false); // Foreign key constraint fails fix $this->db->setQuery('SET FOREIGN_KEY_CHECKS=0')->execute(); foreach ($tables as $table) { if ('sqlite_sequence' == $table) { continue; } $this->db->dropTable($table); $this->app->out('.', false); } $this->db->setQuery('SET FOREIGN_KEY_CHECKS=1')->execute(); return $this; }