drop_table() public method

Drop table
public drop_table ( string $tbl ) : boolean
$tbl string the table name
return boolean
 /**
  * test renaming column
  */
 public function test_rename_column()
 {
     $this->adapter->drop_table('users');
     //create it
     $table = $this->adapter->create_table('users');
     $table->column('name', 'string', array('limit' => 20));
     $table->finish();
     $before = $this->adapter->column_info("users", "name");
     $this->assertEquals('character varying(20)', $before['type']);
     $this->assertEquals('name', $before['field']);
     //rename the name column
     $this->adapter->rename_column('users', 'name', 'new_name');
     $after = $this->adapter->column_info("users", "new_name");
     $this->assertEquals('character varying(20)', $after['type']);
     $this->assertEquals('new_name', $after['field']);
     $this->drop_table('users');
 }
Beispiel #2
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);
 }