<?php

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

class AddOrderColumnAndChangeAuthName extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('orders', function (Blueprint $table) {
            $table->timestamp('wms_edittime')->nullable()->index()->default(null)->comment('wms 修改时间');
        });
        \App\Authority::query()
            ->where('name','客户不可见')
            ->update(['name'=>'订单管理-问题件-客户不可见','alias_name'=>'订单管理-问题件-客户不可见']);

    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
        Schema::table('orders', function (Blueprint $table) {
            $table->dropColumn('wms_edittime');
        });
        \App\Authority::query()
            ->where('name','订单管理-问题件-客户不可见')
            ->update(['name'=>'客户不可见','alias_name'=>'客户不可见']);

    }
}
