protected function tearDown() { //delete any tables we created if ($this->adapter->has_table('users', true)) { $this->adapter->drop_table('users'); } }
/** * @param $name * @param $options * @throws Exception * @throws Ruckusing_Exception */ private function init_sql($name, $options) { //are we forcing table creation? If so, drop it first if (array_key_exists('force', $options) && $options['force']) { try { $this->_adapter->drop_table($name); } catch (Ruckusing_Exception $e) { if ($e->getCode() != Ruckusing_Exception::MISSING_TABLE) { throw $e; } //do nothing } } $temp = ""; $create_sql = sprintf("CREATE%s TABLE ", $temp); $create_sql .= sprintf("%s (\n", $this->_adapter->identifier($name)); $this->_sql .= $create_sql; $this->_initialized = true; }
/** * Drop a table * * @param string $tbl the name of the table * * @return boolean */ public function drop_table($tbl) { return $this->_adapter->drop_table($tbl); }