<?php

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

class CreateBomChargesDetailsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {

            Schema::create('bom_charges_details', function (Blueprint $table) {
                $table->id();
                $table->bigInteger('bom_detail_id')->nullable()->unsigned();
                $table->foreign('bom_detail_id')->references('id')->on('bom_details');
                $table->bigInteger('bom_charge_option_id')->nullable()->unsigned();
                $table->foreign('bom_charge_option_id')->references('id')->on('bom_charges_options');
                $table->double('amount')->default(0);
                $table->string('comment')->nullable();
                $table->timestamps();
            });
          
    }

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