EscolaLMS/Auth

View on GitHub
database/migrations/2021_09_16_000000_add_fields_to_groups_table.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

use EscolaLms\Core\Migrations\EscolaMigration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AddFieldsToGroupsTable extends EscolaMigration
{
    public function up()
    {
        Schema::table('groups', function (Blueprint $table) {
            $table->boolean('registerable')->default(false);
            $table->foreignId('parent_id')->nullable();
        });
    }

    public function down()
    {
        Schema::table('groups', function (Blueprint $table) {
            $table->dropColumn('parent_id');
            $table->dropColumn('registerable');
        });
    }
}