Create a new migration instead of editing old one

This commit is contained in:
Toby Zerner 2015-09-14 15:24:41 +09:30
parent 2d5d9a85c0
commit cfa4458308
2 changed files with 42 additions and 2 deletions

View File

@ -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');
});
}
}

View File

@ -0,0 +1,40 @@
<?php
/*
* This file is part of Flarum.
*
* (c) Toby Zerner <toby.zerner@gmail.com>
*
* 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');
});
}
}