<?php

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

class AddDataAuthoritiesWaybill extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        (new Authority(['name'=>'计费模型','alias_name'=>'计费模型']))->save();
        (new Authority(['name'=>'计费模型-查询','alias_name'=>'计费模型-查询']))->save();
        (new Authority(['name'=>'计费模型-录入','alias_name'=>'计费模型-录入']))->save();
        (new Authority(['name'=>'计费模型-编辑','alias_name'=>'计费模型-编辑']))->save();
        (new Authority(['name'=>'计费模型-删除','alias_name'=>'计费模型-删除']))->save();
        (new Authority(['name'=>'承运商','alias_name'=>'承运商']))->save();
        (new Authority(['name'=>'承运商-查询','alias_name'=>'承运商-查询']))->save();
        (new Authority(['name'=>'承运商-录入','alias_name'=>'承运商-录入']))->save();
        (new Authority(['name'=>'承运商-编辑','alias_name'=>'承运商-编辑']))->save();
        (new Authority(['name'=>'承运商-删除','alias_name'=>'承运商-删除']))->save();
        (new Authority(['name'=>'车型','alias_name'=>'车型']))->save();
        (new Authority(['name'=>'车型-查询','alias_name'=>'车型-查询']))->save();
        (new Authority(['name'=>'车型-录入','alias_name'=>'车型-录入']))->save();
        (new Authority(['name'=>'车型-编辑','alias_name'=>'车型-编辑']))->save();
        (new Authority(['name'=>'车型-删除','alias_name'=>'车型-删除']))->save();
        (new Authority(['name'=>'城市','alias_name'=>'城市']))->save();
        (new Authority(['name'=>'城市-查询','alias_name'=>'城市-查询']))->save();
        (new Authority(['name'=>'城市-录入','alias_name'=>'城市-录入']))->save();
        (new Authority(['name'=>'城市-编辑','alias_name'=>'城市-编辑']))->save();
        (new Authority(['name'=>'城市-删除','alias_name'=>'城市-删除']))->save();
        (new Authority(['name'=>'省份','alias_name'=>'省份']))->save();
        (new Authority(['name'=>'省份-查询','alias_name'=>'省份-查询']))->save();
        (new Authority(['name'=>'省份-录入','alias_name'=>'省份-录入']))->save();
        (new Authority(['name'=>'省份-编辑','alias_name'=>'省份-编辑']))->save();
        (new Authority(['name'=>'省份-删除','alias_name'=>'省份-删除']))->save();
        (new Authority(['name'=>'财务报表','alias_name'=>'财务报表']))->save();
        (new Authority(['name'=>'财务报表-查询','alias_name'=>'财务报表-查询']))->save();
        (new Authority(['name'=>'运输管理','alias_name'=>'运输管理']))->save();
        (new Authority(['name'=>'运输管理-查询','alias_name'=>'运输管理-查询']))->save();
        (new Authority(['name'=>'运输管理-录入','alias_name'=>'运输管理-录入']))->save();
        (new Authority(['name'=>'运输管理-编辑','alias_name'=>'运输管理-编辑']))->save();
        (new Authority(['name'=>'运输管理-调度','alias_name'=>'运输管理-调度']))->save();
        (new Authority(['name'=>'运输管理-删除','alias_name'=>'运输管理-删除']))->save();
        (new Authority(['name'=>'运输管理-运单审核','alias_name'=>'运输管理-运单审核']))->save();
        (new Authority(['name'=>'运输管理-调度审核','alias_name'=>'运输管理-调度审核']))->save();
        (new Authority(['name'=>'运输管理-可见费用项','alias_name'=>'运输管理-调度审核']))->save();
        (new Authority(['name'=>'计量单位','alias_name'=>'计量单位']))->save();
        (new Authority(['name'=>'计量单位-查询','alias_name'=>'计量单位-查询']))->save();
        (new Authority(['name'=>'计量单位-录入','alias_name'=>'计量单位-录入']))->save();
        (new Authority(['name'=>'计量单位-编辑','alias_name'=>'计量单位-编辑']))->save();
        (new Authority(['name'=>'计量单位-删除','alias_name'=>'计量单位-删除']))->save();
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Authority::where('name','计费模型')->delete();
        Authority::where('name','计费模型-查询')->delete();
        Authority::where('name','计费模型-录入')->delete();
        Authority::where('name','计费模型-编辑')->delete();
        Authority::where('name','计费模型-删除')->delete();
        Authority::where('name','承运商')->delete();
        Authority::where('name','承运商-查询')->delete();
        Authority::where('name','承运商-录入')->delete();
        Authority::where('name','承运商-编辑')->delete();
        Authority::where('name','承运商-删除')->delete();
        Authority::where('name','车型')->delete();
        Authority::where('name','车型-查询')->delete();
        Authority::where('name','车型-录入')->delete();
        Authority::where('name','车型-编辑')->delete();
        Authority::where('name','车型-删除')->delete();
        Authority::where('name','城市')->delete();
        Authority::where('name','城市-查询')->delete();
        Authority::where('name','城市-录入')->delete();
        Authority::where('name','城市-编辑')->delete();
        Authority::where('name','城市-删除')->delete();
        Authority::where('name','省份')->delete();
        Authority::where('name','省份-查询')->delete();
        Authority::where('name','省份-录入')->delete();
        Authority::where('name','省份-编辑')->delete();
        Authority::where('name','省份-删除')->delete();
        Authority::where('name','财务报表')->delete();
        Authority::where('name','财务报表-查询')->delete();
        Authority::where('name','运输管理')->delete();
        Authority::where('name','运输管理-查询')->delete();
        Authority::where('name','运输管理-录入')->delete();
        Authority::where('name','运输管理-编辑')->delete();
        Authority::where('name','运输管理-调度')->delete();
        Authority::where('name','运输管理-删除')->delete();
        Authority::where('name','运输管理-运单审核')->delete();
        Authority::where('name','运输管理-调度审核')->delete();
        Authority::where('name','运输管理-可见费用项')->delete();
        Authority::where('name','计量单位')->delete();
        Authority::where('name','计量单位-查询')->delete();
        Authority::where('name','计量单位-录入')->delete();
        Authority::where('name','计量单位-编辑')->delete();
        Authority::where('name','计量单位-删除')->delete();
    }
}
