Use new migration format

This commit is contained in:
Franz Liedke 2016-02-24 23:14:03 +09:00
parent 1fdac619ba
commit 3bfd9b7fea
2 changed files with 16 additions and 26 deletions

View File

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

View File

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