Ruckusing_Adapter_PgSQL_Base::drop_table PHP Method

drop_table() public method

Drop table
public drop_table ( string $tbl ) : boolean
$tbl string the table name
return boolean
    public function drop_table($tbl)
    {
        $ddl = sprintf("DROP TABLE IF EXISTS %s", $this->quote_table_name($tbl));
        $result = $this->query($ddl);
        return true;
    }

Usage Example

 /**
  * 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');
 }
All Usage Examples Of Ruckusing_Adapter_PgSQL_Base::drop_table