<?php

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

class CreateRfqSuppliersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('rfq_suppliers', function (Blueprint $table) {
            $table->id();
            $table->bigInteger('rfq_id')->nullable()->unsigned();
            $table->foreign('rfq_id')->references('id')->on('request_for_quotations');
            $table->bigInteger('client_id')->nullable()->unsigned();
            $table->foreign('client_id')->references('id')->on('clients');
            $table->string('supplier_reference_no')->nullable();
            $table->double('additional_charges_amount')->nullable();
            $table->double('total_before_tax')->nullable();
            $table->double('total_tax')->nullable();
            $table->double('grant_total')->nullable();
            $table->string('overall_comment')->nullable();
            $table->timestamps();
            $table->softDeletes();
        });
    }

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