/** * test dropping column */ public function test_remove_column() { $this->drop_table('users'); //create it $table = $this->adapter->create_table('users'); $table->column('name', 'string', array('limit' => 20)); $table->column('age', 'integer'); $table->finish(); //verify it exists $col = $this->adapter->column_info("users", "name"); $this->assertEquals("name", $col['field']); //drop it $this->adapter->remove_column("users", "name"); //verify it does not exist $col = $this->adapter->column_info("users", "name"); $this->assertEquals(null, $col); $this->drop_table('users'); }
/** * Remove a column * * @param string $table_name the name of the table * @param string $column_name the column name * * @return boolean */ public function remove_column($table_name, $column_name) { return $this->_adapter->remove_column($table_name, $column_name); }