mirror of
https://github.com/flarum/framework.git
synced 2025-02-21 09:11:40 +08:00
Use new shortcuts for migrations
This commit is contained in:
parent
f26b1a56da
commit
69ab036bb8
@ -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('discussions', function (Blueprint $table) {
|
||||
$table->boolean('is_approved')->default(1);
|
||||
});
|
||||
},
|
||||
|
||||
'down' => function (Builder $schema) {
|
||||
$schema->table('discussions', function (Blueprint $table) {
|
||||
$table->dropColumn('is_approved');
|
||||
});
|
||||
}
|
||||
];
|
||||
return Migration::addColumns('discussions', [
|
||||
'is_approved' => ['boolean', 'default' => 1]
|
||||
]);
|
||||
|
@ -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('posts', function (Blueprint $table) {
|
||||
$table->boolean('is_approved')->default(1);
|
||||
});
|
||||
},
|
||||
|
||||
'down' => function (Builder $schema) {
|
||||
$schema->table('posts', function (Blueprint $table) {
|
||||
$table->dropColumn('is_approved');
|
||||
});
|
||||
}
|
||||
];
|
||||
return Migration::addColumns('posts', [
|
||||
'is_approved' => ['boolean', 'default' => 1]
|
||||
]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user