<?php

use App\Classes\ValueObjects\Constants\OrderRoleTypes;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateOrderRolesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('order_roles', function (Blueprint $table) {
            $table->id();
            $table->foreignId('order_id');
            $table->foreignId('company_module_id');
            $table->integer('role_id')->default(OrderRoleTypes::IMPORTER);
            $table->string('entity_hash_id',200)->nullable();
            $table->string('entity_signature',200)->nullable();
            $table->softDeletes();
            $table->timestamps();
        });
    }

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