From 3a2699a7bfadda256a554de22e452f73366c8f4c Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Fri, 4 Mar 2016 01:12:58 +0900 Subject: [PATCH] Use new shortcuts for migrations --- ...000_add_suspended_until_to_users_table.php | 19 ++++--------------- ...4_000000_rename_suspended_until_column.php | 17 ++--------------- 2 files changed, 6 insertions(+), 30 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 4d61d53c1..26a146e5f 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,19 +8,8 @@ * file that was distributed with this source code. */ -use Illuminate\Database\Schema\Blueprint; -use Illuminate\Database\Schema\Builder; +use Flarum\Database\Migration; -return [ - 'up' => function (Builder $schema) { - $schema->table('users', function (Blueprint $table) { - $table->dateTime('suspended_until')->nullable(); - }); - }, - - 'down' => function (Builder $schema) { - $schema->table('users', function (Blueprint $table) { - $table->dropColumn('suspended_until'); - }); - } -]; +return Migration::addColumns('users', [ + 'suspended_until' => ['dateTime', 'nullable' => true] +]); 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 17248c187..698f43b44 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,19 +8,6 @@ * file that was distributed with this source code. */ -use Illuminate\Database\Schema\Blueprint; -use Illuminate\Database\Schema\Builder; +use Flarum\Database\Migration; -return [ - 'up' => function (Builder $schema) { - $schema->table('users', function (Blueprint $table) { - $table->renameColumn('suspended_until', 'suspend_until'); - }); - }, - - 'down' => function (Builder $schema) { - $schema->table('users', function (Blueprint $table) { - $table->renameColumn('suspend_until', 'suspended_until'); - }); - } -]; +return Migration::renameColumn('users', 'suspended_until', 'suspend_until');