<?php

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

class AddFinanceConfirmToOrderIssueAndAddAuth extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('order_issues', function (Blueprint $table) {
            //
            $table->enum('finance_confirm',['是','否'])->default('否')->after('rejecting_status')->comment('财务确认');
        });
        \App\Authority::query()->create(['name'=>'订单管理-问题件-财务确认','alias_name'=>'订单管理-问题件-财务确认']);
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('order_issues', function (Blueprint $table) {
            //
            $table->dropColumn('finance_confirm');
        });
        \App\Authority::query()->where('name','订单管理-问题件-财务确认')->delete();
    }
}
