mirror of
https://github.com/flarum/core.git
synced 2025-07-28 12:10:51 +02:00
Use new shortcuts for migrations
This commit is contained in:
@@ -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');
|
||||
|
Reference in New Issue
Block a user