mirror of
https://github.com/flarum/framework.git
synced 2025-02-08 15:49:30 +08:00
Create a new migration instead of editing old one
This commit is contained in:
parent
2d5d9a85c0
commit
cfa4458308
|
@ -22,7 +22,7 @@ class AddSuspendedUntilToUsersTable extends Migration
|
||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
$this->schema->table('users', function (Blueprint $table) {
|
$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()
|
public function down()
|
||||||
{
|
{
|
||||||
$this->schema->table('users', function (Blueprint $table) {
|
$this->schema->table('users', function (Blueprint $table) {
|
||||||
$table->dropColumn('suspend_until');
|
$table->dropColumn('suspended_until');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user