<?php

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

class CreatePoReceivedNoteTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('po_received_note', function (Blueprint $table) {
            $table->id();
            $table->bigInteger('purchase_order_id')->nullable()->unsigned();
            $table->foreign('purchase_order_id')->references('id')->on('purchase_order');
            $table->string('file')->nullable();
            $table->string('mm_no')->nullable();
            $table->bigInteger('reviewed_by_user_id')->nullable()->unsigned();
            $table->foreign('reviewed_by_user_id')->references('id')->on('users');
            $table->string('reference_no')->nullable();
            $table->timestamps();
        });
    }

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