<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateGroupsHasForumsPermissionsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('forums_has_group_permissions', function (Blueprint $table) {
            $table->id();
            $table->uuid('uuid')->index('uuid');
            $table->dateTime('created_at');
            $table->uuid('created_uuid')->index('created_uuid');
            $table->dateTime('updated_at');
            $table->uuid('updated_uuid')->index('updated_uuid');
            $table->uuid('group_uuid')->index('group_uuid');
            $table->uuid('forum_uuid')->index('forum_uuid');
            $table->boolean('show_forum')->default(0);
            $table->boolean('show_threads')->default(0);
            $table->boolean('show_posts')->default(0);
            $table->boolean('create_threads')->default(0);
            $table->boolean('create_posts')->default(0);
            $table->boolean('edit_threads')->default(0);
            $table->boolean('edit_posts')->default(0);
            $table->boolean('delete_threads')->default(0);
            $table->boolean('delete_posts')->default(0);
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('groups_has_forums_permissions');
    }
}
