INSERT INTO ias_upgrade_logs (
    version,
    released_at,
    title,
    description,
    changes,
    modules
) VALUES (
    '0.2.21',
    '2026-07-08T00:00:00+08:00',
    'HTTP API 功能分组说明',
    'HTTP API 文档新增功能分组索引，AI 可先查看 API 面向，再按关键词或 endpoint id 查询具体接口。',
    '[
        "HTTP API 文档新增功能分组说明，/v1/api-docs 会返回 groups，描述 system、updates、api-docs、web、mail、console、context 等 API 面向及主要功能。",
        "API 文档搜索会把功能分组的标题、说明、功能面和关键词纳入匹配；例如查询未读或邮箱目录可直接命中邮件相关接口。",
        "query_api_docs 的列表输出会先展示 API 功能分组，并在每个 endpoint 简表中补充完整说明；查询单个 endpoint 时会附带所属功能分组说明。",
        "数据库无结构变化。"
    ]'::jsonb,
    '{
        "ias-common": "0.1.2",
        "ias-ai": "0.1.10",
        "ias-wechat": "0.1.1",
        "ias-context": "0.1.4",
        "ias-http": "0.1.13",
        "ias-mail": "0.1.15",
        "ias-service": "0.1.18",
        "ias-main": "0.2.21"
    }'::jsonb
) ON CONFLICT (version) DO UPDATE SET
    released_at = EXCLUDED.released_at,
    title = EXCLUDED.title,
    description = EXCLUDED.description,
    changes = EXCLUDED.changes,
    modules = EXCLUDED.modules;
