<?php

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

return new class extends Migration
{
    /**
     * menus 테이블에 options JSON 컬럼 추가
     * - 범용 확장 데이터 저장용 (mng, api, react 등에서 활용 가능)
     * - nullable이므로 기존 데이터에 영향 없음
     */
    public function up(): void
    {
        Schema::table('menus', function (Blueprint $table) {
            $table->json('options')->nullable()
                ->after('external_url')
                ->comment('확장 옵션 JSON: route_name, section, menu_type, requires_role, meta 등');
        });
    }

    public function down(): void
    {
        Schema::table('menus', function (Blueprint $table) {
            $table->dropColumn('options');
        });
    }
};
