<?php

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

class CreateQuotChallanTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('quot_challan', function (Blueprint $table) {
            $table->id();
            $table->bigInteger('quotation_id')->nullable()->unsigned();
            $table->foreign('quotation_id')->references('id')->on('quotation');
            $table->string('reference_no')->nullable();
            $table->bigInteger('transporter_details_id')->nullable()->unsigned();
            $table->foreign('transporter_details_id')->references('id')->on('transporter_details');
            $table->string('transporter_doc_no')->nullable();
            $table->string('vehical_no')->nullable();
            $table->date('transportation_doc_date')->nullable();
            $table->string('delivery_note')->nullable();
            $table->string('kind_attention')->nullable();
            $table->string('attachment_file')->nullable();
            $table->string('comment')->nullable();
            $table->bigInteger('tcn_id')->nullable()->unsigned();
            $table->foreign('tcn_id')->references('id')->on('terms_and_conditaions');

            $table->string('signature_file')->nullable();
            $table->timestamps();
        });
    }

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