<?php

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

class CreateBomRoutingTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('bom_routing', function (Blueprint $table) {
            $table->id();
            $table->bigInteger('bom_id')->nullable()->unsigned();
            $table->foreign('bom_id')->references('id')->on('bill_of_materials');
            $table->string('routing_name')->nullable();
            $table->text('description')->nullable();
            $table->integer('routing_no')->nullable();
            $table->string('comment')->nullable();
            $table->softDeletes();
            $table->timestamps();
        });
    }

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