<?php

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

class AddWarehouseIdColumnOwnersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('owners', function (Blueprint $table) {
            $table->bigInteger("warehouse_id")->index()->nullable()->comment("外键仓库");
        });
        Schema::table('owner_storage_price_models', function (Blueprint $table) {
            $table->string("name")->comment("名称");
        });
    }

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