<?php

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

class CreateProcurementTotalBillsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('procurement_total_bills', function (Blueprint $table) {
            $table->id();
            $table->date('counting_month')->index()->comment('结算月');
            $table->bigInteger('supplier_id')->index()->comment('外键供应商');
            $table->tinyInteger('status')->default(0)->comment('状态');
            $table->decimal('total_payable',10,4)->comment('总金额');
            $table->timestamps();
        });
    }

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