Use new shortcuts for migrations

This commit is contained in:
Franz Liedke 2016-03-04 01:12:58 +09:00
parent 5d3b0f6f10
commit 3a2699a7bf
2 changed files with 6 additions and 30 deletions

View File

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

View File

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