From e62dd6a3a1637d40c660028982cd9e81e3261aa5 Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Wed, 24 Feb 2016 23:12:36 +0900 Subject: [PATCH] Use new migration format --- ...000_add_flags_read_time_to_users_table.php | 21 +++++++------------ .../2015_09_02_000000_create_flags_table.php | 21 +++++++------------ 2 files changed, 16 insertions(+), 26 deletions(-) diff --git a/extensions/flags/migrations/2015_09_02_000000_add_flags_read_time_to_users_table.php b/extensions/flags/migrations/2015_09_02_000000_add_flags_read_time_to_users_table.php index 5f470ff4f..c00faa5c2 100644 --- a/extensions/flags/migrations/2015_09_02_000000_add_flags_read_time_to_users_table.php +++ b/extensions/flags/migrations/2015_09_02_000000_add_flags_read_time_to_users_table.php @@ -8,22 +8,17 @@ * file that was distributed with this source code. */ -namespace Flarum\Flags\Migration; - -use Flarum\Database\AbstractMigration; use Illuminate\Database\Schema\Blueprint; +use Illuminate\Database\Schema\Builder; -class AddFlagsReadTimeToUsersTable extends AbstractMigration -{ - public function up() - { - $this->schema->table('users', function (Blueprint $table) { +return [ + 'up' => function (Builder $schema) { + $schema->table('users', function (Blueprint $table) { $table->dateTime('flags_read_time')->nullable(); }); - } + }, - public function down() - { - $this->schema->drop('flags_read_time'); + 'down' => function (Builder $schema) { + $schema->drop('flags_read_time'); } -} +]; diff --git a/extensions/flags/migrations/2015_09_02_000000_create_flags_table.php b/extensions/flags/migrations/2015_09_02_000000_create_flags_table.php index caa81b043..13088e751 100644 --- a/extensions/flags/migrations/2015_09_02_000000_create_flags_table.php +++ b/extensions/flags/migrations/2015_09_02_000000_create_flags_table.php @@ -8,16 +8,12 @@ * file that was distributed with this source code. */ -namespace Flarum\Flags\Migration; - -use Flarum\Database\AbstractMigration; use Illuminate\Database\Schema\Blueprint; +use Illuminate\Database\Schema\Builder; -class CreateFlagsTable extends AbstractMigration -{ - public function up() - { - $this->schema->create('flags', function (Blueprint $table) { +return [ + 'up' => function (Builder $schema) { + $schema->create('flags', function (Blueprint $table) { $table->increments('id'); $table->integer('post_id')->unsigned(); $table->string('type'); @@ -26,10 +22,9 @@ class CreateFlagsTable extends AbstractMigration $table->string('reason_detail')->nullable(); $table->dateTime('time'); }); - } + }, - public function down() - { - $this->schema->drop('flags'); + 'down' => function (Builder $schema) { + $schema->drop('flags'); } -} +];