<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::rename('chart_of_account_sub_types', 'accounting_groups');
        Schema::table('accounting_groups', function (Blueprint $table) {
            $table->renameColumn('chart_of_account_type_id', 'accounting_type_id');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::rename('accounting_groups', 'chart_of_account_sub_types');
    }
};
