1
0
mirror of https://github.com/flarum/core.git synced 2025-08-03 23:17:43 +02:00

Add migration helper to drop columns

This commit is contained in:
Toby Zerner
2018-09-22 13:45:41 +09:30
parent ee3287d3e9
commit 8107d9787c

View File

@@ -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.
*/