mirror of
https://github.com/flarum/framework.git
synced 2025-04-30 00:24:04 +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.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
use Flarum\Database\Migration;
|
||||||
use Illuminate\Database\Schema\Builder;
|
|
||||||
|
|
||||||
return [
|
return Migration::addColumns('users', [
|
||||||
'up' => function (Builder $schema) {
|
'suspended_until' => ['dateTime', 'nullable' => true]
|
||||||
$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');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
@ -8,19 +8,6 @@
|
|||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
use Flarum\Database\Migration;
|
||||||
use Illuminate\Database\Schema\Builder;
|
|
||||||
|
|
||||||
return [
|
return Migration::renameColumn('users', 'suspended_until', 'suspend_until');
|
||||||
'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');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user