<?php

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

class CreateBomRoutingMappingTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('bom_routing_mapping', function (Blueprint $table) {
            $table->id();
            $table->bigInteger('bom_id')->nullable()->unsigned();
            $table->foreign('bom_id')->references('id')->on('bill_of_materials');
            $table->bigInteger('bom_routing_id')->nullable()->unsigned();
            $table->foreign('bom_routing_id')->references('id')->on('bom_routing');
            $table->timestamps();
        });
    }

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