mirror of
https://github.com/flarum/framework.git
synced 2025-02-18 22:12:50 +08:00
Add migration helper to drop columns
This commit is contained in:
parent
4429cf4eba
commit
fcb97b256f
|
@ -74,6 +74,19 @@ abstract class Migration
|
|||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Drop columns from a table.
|
||||
*/
|
||||
public static function dropColumns($tableName, array $columnDefinitions)
|
||||
{
|
||||
$inverse = static::addColumns($tableName, $columnDefinitions);
|
||||
|
||||
return [
|
||||
'up' => $inverse['down'],
|
||||
'down' => $inverse['up']
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Rename a column.
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue
Block a user