<?php

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

class AddOrdersIndexOwnerIdAndAddProcessesColumnBalanceRemark extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('orders', function (Blueprint $table) {
            $table->index('owner_id','orders_owner_id_index');
        });
        Schema::table('processes', function (Blueprint $table) {
            $table->string('balance_remark')->nullable()->comment('结算备注(上个备注字段为加工备注)');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('orders', function (Blueprint $table) {
            $table->dropIndex('orders_owner_id_index');
        });
        Schema::table('processes', function (Blueprint $table) {
            $table->dropColumn('balance_remark');
        });
    }
}
