<?php

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

class AddColumnUnitIdTableProcessMethods extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('process_methods', function (Blueprint $table) {
            $table->bigInteger("unit_id")->nullable()->index()->comment('外键单位');
            $table->decimal("unit_price",8,4)->nullable()->comment("单价");
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('process_methods', function (Blueprint $table) {
            $table->dropColumn("unit_id");
            $table->dropColumn("unit_price");
        });
    }
}
