<?php

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

class ChangeAppointmentCarsAddStatusColumn extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('delivery_appointment_cars', function (Blueprint $table) {
            $table->tinyInteger("status")->default(0)->comment("状态");
        });
        \App\Authority::query()->firstOrCreate([
            "name" => "入库管理-客户预约-预约管理-卸货完成",
            "alias_name" => "入库管理-客户预约-预约管理-卸货完成",
        ]);
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('delivery_appointment_cars', function (Blueprint $table) {
            $table->dropColumn("status");
        });
        \App\Authority::query()->where("name","入库管理-客户预约-预约管理-卸货完成")->delete();
    }
}
