<?php

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

class ChangeOrderFreezeTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('order_freezes', function (Blueprint $table) {
            $table->renameColumn("location_id","district_id");
            $table->bigInteger("town_id")->nullable()->comment("外键乡镇");
            $table->bigInteger("street_id")->nullable()->comment("外键村街");
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('order_freezes', function (Blueprint $table) {
            $table->renameColumn("district_id","location_id");
            $table->dropColumn("town_id");
            $table->dropColumn("street_id");
        });
    }
}
