<?php

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

class CreateQuotPiExtraChargesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('quot_pi_extra_charges', function (Blueprint $table) {
            $table->id();
            $table->bigInteger('quot_proforma_invoice_id')->nullable()->unsigned();
            $table->foreign('quot_proforma_invoice_id')->references('id')->on('quot_proforma_invoice');
            $table->string('extra_charge_description')->nullable();
            $table->double('total_amount')->nullable();
            $table->bigInteger('indirect_tax_id')->nullable()->unsigned();
            $table->foreign('indirect_tax_id')->references('id')->on('indirect_tax');
            $table->double('total_tax')->nullable();
            $table->timestamps();
        });
    }

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