public dropColumn ( string $table, string $column ) | ||
$table | string | the table whose column is to be dropped. The name will be properly quoted by the method. |
$column | string | the name of the column to be dropped. The name will be properly quoted by the method. |
public function dropColumn($table, $column)
{
echo " > drop column {$column} from table {$table} ...";
$time = microtime(true);
$this->db->createCommand()->dropColumn($table, $column)->execute();
echo ' done (time: ' . sprintf('%.3f', microtime(true) - $time) . "s)\n";
}
/** * Drop multiple columns to a table * @param string $table * @param array $columns ["column_name"=>type] */ public function dropColumns($table, $columns) { foreach ($columns as $column => $type) { parent::dropColumn($table, $column); } }