From cfa445830827984ec32e3ff1580c1a80ea9c6ffc Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Mon, 14 Sep 2015 15:24:41 +0930 Subject: [PATCH] Create a new migration instead of editing old one --- ...000_add_suspended_until_to_users_table.php | 4 +- ...4_000000_rename_suspended_until_column.php | 40 +++++++++++++++++++ 2 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 extensions/suspend/migrations/2015_09_14_000000_rename_suspended_until_column.php 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 73fd2312e..ac4c4e2e3 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 @@ -22,7 +22,7 @@ class AddSuspendedUntilToUsersTable extends Migration public function up() { $this->schema->table('users', function (Blueprint $table) { - $table->dateTime('suspend_until')->nullable(); + $table->dateTime('suspended_until')->nullable(); }); } @@ -34,7 +34,7 @@ class AddSuspendedUntilToUsersTable extends Migration public function down() { $this->schema->table('users', function (Blueprint $table) { - $table->dropColumn('suspend_until'); + $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 new file mode 100644 index 000000000..3aa10f5f6 --- /dev/null +++ b/extensions/suspend/migrations/2015_09_14_000000_rename_suspended_until_column.php @@ -0,0 +1,40 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use Illuminate\Database\Schema\Blueprint; +use Flarum\Migrations\Migration; + +class RenameSuspendedUntilColumn extends Migration +{ + /** + * Run the migrations. + * + * @return void + */ + public function up() + { + $this->schema->table('users', function (Blueprint $table) { + $table->renameColumn('suspended_until', 'suspend_until'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + $this->schema->table('users', function (Blueprint $table) { + $table->renameColumn('suspend_until', 'suspended_until'); + }); + } +}