<?php

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

return new class extends Migration
{
    public function up()
    {
        Schema::table('grant_dept_map', function (Blueprint $table) {

            // Remove column
            $table->dropColumn('Lg_Id');

            // Add new column
            $table->longText('Bh_Id')->nullable()->after('Dept_Id');
        });
    }

    public function down()
    {
        Schema::table('grant_dept_map', function (Blueprint $table) {

            // Add back Lg_Id
            $table->longText('Lg_Id')->nullable();

            // Remove Bh_Id
            $table->dropColumn('Bh_Id');
        });
    }
};
