mirror of
https://github.com/flarum/core.git
synced 2025-07-21 08:41:17 +02:00
Use new shortcuts for migrations
This commit is contained in:
@@ -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('discussions', [
|
||||||
'up' => function (Builder $schema) {
|
'is_approved' => ['boolean', 'default' => 1]
|
||||||
$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');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
@@ -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('posts', [
|
||||||
'up' => function (Builder $schema) {
|
'is_approved' => ['boolean', 'default' => 1]
|
||||||
$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');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
Reference in New Issue
Block a user