mirror of
https://github.com/flarum/framework.git
synced 2025-03-04 03:29:54 +08:00
Use new shortcuts for migrations
This commit is contained in:
parent
5d3b0f6f10
commit
3a2699a7bf
@ -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]
|
||||
]);
|
||||
|
@ -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');
|
||||
|
Loading…
x
Reference in New Issue
Block a user