<?php

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

class CreateProcurementQuotationsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('procurement_quotations', function (Blueprint $table) {
            $table->id();
            $table->bigInteger('procurement_id')->index()->comment('外键采购单');
            $table->bigInteger('supplier_id')->index()->comment('外键供应商');
            $table->decimal('offer')->nullable()->comment('报价');
            $table->bigInteger('operator')->index()->comment('操作者');
            $table->timestamp('quoted_at')->nullable()->comment('报价时间');
            $table->tinyInteger('status')->default(0)->comment('状态');
            $table->timestamps();
        });
    }

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