<?php

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

class CreateQuotInvoiceTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('quot_invoice', function (Blueprint $table) {
            $table->id();
            $table->bigInteger('quotation_id')->nullable()->unsigned();
            $table->foreign('quotation_id')->references('id')->on('quotation');
            $table->bigInteger('payment_mode_id')->nullable()->unsigned();
            $table->foreign('payment_mode_id')->references('id')->on('payment_mode');
            $table->string('file')->nullable();
            $table->bigInteger('reviewed_by_user_id')->nullable()->unsigned();
            $table->foreign('reviewed_by_user_id')->references('id')->on('users');
            $table->date('payment_date')->nullable();
            $table->string('reference_no')->nullable();
            $table->double('amount')->nullable();
            $table->timestamps();
            $table->softDeletes();
        });
    }

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