<?php

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

class CreatePostsHasGroupsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('posts_has_groups', 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('post_uuid')->index('post_uuid');
            $table->uuid('group_uuid')->index('group_uuid');
        });
    }

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