<?php

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

class CreateOwnerAreaReportsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('owner_area_reports', function (Blueprint $table) {
            $table->id();
            $table->bigInteger('owner_id')->index()->comment('外键货主');
            $table->date('counting_month')->index()->comment('结算月');
            $table->bigInteger('user_owner_group_id')->index()->nullable()->comment('项目组');
            $table->decimal('area_on_tray',8,2)->nullable()->comment('货物整托');
            $table->decimal('area_on_half_tray',8,2)->nullable()->comment('货物半托');
            $table->decimal('area_on_flat',8,2)->nullable()->comment('平面区面积');
            $table->decimal('accounting_area',8,2)->nullable()->comment('结算面积');
            $table->enum('status',['编辑中','已完成'])->default('编辑中')->comment('状态');
            $table->bigInteger("owner_storage_price_model_id")->index()->comment("关联仓储计费标准");
            $table->timestamps();
        });
    }

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