INSERT INTO ias_upgrade_logs (
    version,
    released_at,
    title,
    description,
    changes,
    modules
) VALUES (
    '0.1.12',
    '2026-07-06T00:00:00+08:00',
    '邮件 HTTP 查询服务增强',
    '增强邮件 HTTP 查询接口，支持关键词、账户、邮箱目录、来源和分页查询，并新增查询语义别名路由。',
    '[
        "增强邮件 HTTP 查询服务：GET /mail-api/messages 支持关键词、账户、邮箱目录、来源和分页查询。",
        "新增 GET /mail-api/search 作为邮件查询别名，便于客户端直接按查询语义调用。",
        "邮件列表响应新增 page、per_page 和 total 字段，保留 limit 参数的兼容行为。",
        "查询关键词 q 会匹配发件人、主题、摘要、正文和 Message-ID。",
        "无数据库结构变化。"
    ]'::jsonb,
    '{
        "ias-common": "0.1.0",
        "ias-ai": "0.1.0",
        "ias-wechat": "0.1.0",
        "ias-context": "0.1.0",
        "ias-http": "0.1.0",
        "ias-mail": "0.1.5",
        "ias-service": "0.1.1",
        "ias-main": "0.1.12"
    }'::jsonb
) ON CONFLICT (version) DO UPDATE SET
    released_at = EXCLUDED.released_at,
    title = EXCLUDED.title,
    description = EXCLUDED.description,
    changes = EXCLUDED.changes,
    modules = EXCLUDED.modules;
