mirror of
https://github.com/flarum/framework.git
synced 2025-02-25 19:34:26 +08:00
Add migration helper to drop columns
This commit is contained in:
parent
ee3287d3e9
commit
8107d9787c
@ -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.
|
* Rename a column.
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user