From 3bfd9b7feaa3c5fbf91bae43245f13050eab3c0d Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Wed, 24 Feb 2016 23:14:03 +0900 Subject: [PATCH] Use new migration format --- ...000_add_suspended_until_to_users_table.php | 21 +++++++------------ ...4_000000_rename_suspended_until_column.php | 21 +++++++------------ 2 files changed, 16 insertions(+), 26 deletions(-) diff --git a/extensions/suspend/migrations/2015_05_11_000000_add_suspended_until_to_users_table.php b/extensions/suspend/migrations/2015_05_11_000000_add_suspended_until_to_users_table.php index ab59a0e7f..4d61d53c1 100644 --- a/extensions/suspend/migrations/2015_05_11_000000_add_suspended_until_to_users_table.php +++ b/extensions/suspend/migrations/2015_05_11_000000_add_suspended_until_to_users_table.php @@ -8,24 +8,19 @@ * file that was distributed with this source code. */ -namespace Flarum\Suspend\Migration; - -use Flarum\Database\AbstractMigration; use Illuminate\Database\Schema\Blueprint; +use Illuminate\Database\Schema\Builder; -class AddSuspendedUntilToUsersTable 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('suspended_until')->nullable(); }); - } + }, - public function down() - { - $this->schema->table('users', function (Blueprint $table) { + 'down' => function (Builder $schema) { + $schema->table('users', function (Blueprint $table) { $table->dropColumn('suspended_until'); }); } -} +]; diff --git a/extensions/suspend/migrations/2015_09_14_000000_rename_suspended_until_column.php b/extensions/suspend/migrations/2015_09_14_000000_rename_suspended_until_column.php index f97b6f29a..17248c187 100644 --- a/extensions/suspend/migrations/2015_09_14_000000_rename_suspended_until_column.php +++ b/extensions/suspend/migrations/2015_09_14_000000_rename_suspended_until_column.php @@ -8,24 +8,19 @@ * file that was distributed with this source code. */ -namespace Flarum\Suspend\Migration; - -use Flarum\Database\AbstractMigration; use Illuminate\Database\Schema\Blueprint; +use Illuminate\Database\Schema\Builder; -class RenameSuspendedUntilColumn extends AbstractMigration -{ - public function up() - { - $this->schema->table('users', function (Blueprint $table) { +return [ + 'up' => function (Builder $schema) { + $schema->table('users', function (Blueprint $table) { $table->renameColumn('suspended_until', 'suspend_until'); }); - } + }, - public function down() - { - $this->schema->table('users', function (Blueprint $table) { + 'down' => function (Builder $schema) { + $schema->table('users', function (Blueprint $table) { $table->renameColumn('suspend_until', 'suspended_until'); }); } -} +];