mirror of
https://github.com/flarum/framework.git
synced 2025-02-27 20:04:26 +08:00
Use new shortcuts for migrations
This commit is contained in:
parent
32519c47de
commit
bba105748b
@ -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_spam' => ['boolean', 'default' => 0]
|
||||||
$schema->table('posts', function (Blueprint $table) {
|
]);
|
||||||
$table->boolean('is_spam')->default(0);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
'down' => function (Builder $schema) {
|
|
||||||
$schema->table('posts', function (Blueprint $table) {
|
|
||||||
$table->dropColumn('is_spam');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user