<?php

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

class CreateOwnerBillReportsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('owner_bill_reports', function (Blueprint $table) {
            $table->engine = 'InnoDB';
            $table->id();
            $table->bigInteger('owner_id')->index()->comment('外键项目');
            $table->date('counting_month')->index()->comment('结算月');
            $table->decimal('initial_fee',8,4)->nullable()->comment('原始账单金额');
            $table->decimal('confirm_fee',8,4)->nullable()->comment('确认账单金额');
            $table->decimal('difference',8,4)->nullable()->comment('差额');
            $table->enum('confirmed',["是","否"])->default("否")->comment("确认状态");
            $table->timestamps();
        });
    }

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