<?php

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

return new class extends Migration
{
    public function up(): void
    {
        if (!Schema::hasColumn('accounts', 'detail_type')) {
            Schema::table('accounts', function (Blueprint $table) {
                $table->string('detail_type', 100)->nullable()->after('sub_type');
            });
        }
    }

    public function down(): void
    {
        if (Schema::hasColumn('accounts', 'detail_type')) {
            Schema::table('accounts', function (Blueprint $table) {
                $table->dropColumn('detail_type');
            });
        }
    }
};
