1
0
mirror of https://github.com/flarum/core.git synced 2025-07-30 21:20:24 +02:00

Use the new migration shortcuts in most of core's migrations

This commit is contained in:
Franz Liedke
2016-02-25 00:50:54 +09:00
parent db7a03fbe5
commit 2b5dab73f9
18 changed files with 149 additions and 255 deletions

View File

@@ -8,19 +8,14 @@
* file that was distributed with this source code.
*/
use Flarum\Database\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Schema\Builder;
return [
'up' => function (Builder $schema) {
$schema->create('permissions', function (Blueprint $table) {
$table->integer('group_id')->unsigned();
$table->string('permission', 100);
$table->primary(['group_id', 'permission']);
});
},
'down' => function (Builder $schema) {
$schema->drop('permissions');
return Migration::createTable(
'permissions',
function (Blueprint $table) {
$table->integer('group_id')->unsigned();
$table->string('permission', 100);
$table->primary(['group_id', 'permission']);
}
];
);