<?php

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

class AddOrderClientNo extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('orders', function (Blueprint $table) {
            $table->string('client_code')->index()->nullable()->comment('客户订单编号');
        });
        Schema::table('order_issues', function (Blueprint $table) {
            $table->dropColumn('handle_status');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('orders', function (Blueprint $table) {
            $table->dropColumn('client_code');
        });
        Schema::table('order_issues', function (Blueprint $table) {
            $table->enum('handle_status', ['处理中', '已完结'])->default('处理中')->comment('处理状态');
            $table->enum("status",['处理中','未处理','已处理','取消','异常'])->default('未处理');
        });
    }
}
