<?php

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

class CreateOrderIssueUserWorkgroupTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('order_issue_user_workgroup', function (Blueprint $table) {
            $table->bigInteger('order_issue_id');
            $table->bigInteger('user_workgroup_id')->index();
            $table->unique(['order_issue_id', 'user_workgroup_id'],'order_issue_user_workgroup_unique');
        });
    }

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