From d240d4c0ff9309bcb6fa4677e45de1d32f0598e3 Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Mon, 29 Feb 2016 23:42:48 +0900 Subject: [PATCH] Use new shortcuts for migrations --- ...4_000000_create_discussions_tags_table.php | 21 ++++++---------- ...5_02_24_000000_create_users_tags_table.php | 25 ++++++++----------- 2 files changed, 18 insertions(+), 28 deletions(-) diff --git a/extensions/tags/migrations/2015_02_24_000000_create_discussions_tags_table.php b/extensions/tags/migrations/2015_02_24_000000_create_discussions_tags_table.php index 1768b86e2..03180594b 100644 --- a/extensions/tags/migrations/2015_02_24_000000_create_discussions_tags_table.php +++ b/extensions/tags/migrations/2015_02_24_000000_create_discussions_tags_table.php @@ -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('discussions_tags', function (Blueprint $table) { - $table->integer('discussion_id')->unsigned(); - $table->integer('tag_id')->unsigned(); - $table->primary(['discussion_id', 'tag_id']); - }); - }, - - 'down' => function (Builder $schema) { - $schema->drop('discussions_tags'); +return Migration::createTable( + 'discussions_tags', + function (Blueprint $table) { + $table->integer('discussion_id')->unsigned(); + $table->integer('tag_id')->unsigned(); + $table->primary(['discussion_id', 'tag_id']); } -]; +); diff --git a/extensions/tags/migrations/2015_02_24_000000_create_users_tags_table.php b/extensions/tags/migrations/2015_02_24_000000_create_users_tags_table.php index d76f3644f..e249a82a2 100644 --- a/extensions/tags/migrations/2015_02_24_000000_create_users_tags_table.php +++ b/extensions/tags/migrations/2015_02_24_000000_create_users_tags_table.php @@ -8,21 +8,16 @@ * 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('users_tags', function (Blueprint $table) { - $table->integer('user_id')->unsigned(); - $table->integer('tag_id')->unsigned(); - $table->dateTime('read_time')->nullable(); - $table->boolean('is_hidden')->default(0); - $table->primary(['user_id', 'tag_id']); - }); - }, - - 'down' => function (Builder $schema) { - $schema->drop('users_tags'); +return Migration::createTable( + 'users_tags', + function (Blueprint $table) { + $table->integer('user_id')->unsigned(); + $table->integer('tag_id')->unsigned(); + $table->dateTime('read_time')->nullable(); + $table->boolean('is_hidden')->default(0); + $table->primary(['user_id', 'tag_id']); } -]; +);