<?php

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

class ChangeOwnerBillReportsAddColumnBill extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table("owner_bill_reports",function (Blueprint $table){
            $table->dropColumn("initial_fee");
            $table->decimal("work_fee",11,3)->nullable()->comment("操作费");
            $table->decimal("logistic_fee",11,3)->nullable()->comment("物流费");
            $table->decimal("storage_fee",11,3)->nullable()->comment("仓储费");
        });
        DB::statement("ALTER TABLE owner_area_reports MODIFY COLUMN status enum ('编辑中','已审核','已完成') default '编辑中'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table("owner_bill_reports",function (Blueprint $table){
            $table->dropColumn("work_fee");
            $table->dropColumn("logistic_fee");
            $table->dropColumn("storage_fee");
            $table->decimal('initial_fee',11,3)->nullable()->comment('原始账单金额');
        });
        DB::statement("ALTER TABLE owner_area_reports MODIFY COLUMN status enum ('编辑中','已完成') default '编辑中'");
    }
}
