drop_table() public method

public drop_table ( string $table_name ) : boolean
$table_name string
return boolean
コード例 #1
0
 protected function tearDown()
 {
     //delete any tables we created
     if ($this->adapter->has_table('users', true)) {
         $this->adapter->drop_table('users');
     }
 }
コード例 #2
0
 /**
  * @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;
 }
コード例 #3
0
 /**
  * Drop a table
  *
  * @param string $tbl the name of the table
  *
  * @return boolean
  */
 public function drop_table($tbl)
 {
     return $this->_adapter->drop_table($tbl);
 }