INSERT INTO ias_upgrade_logs (
    version,
    released_at,
    title,
    description,
    changes,
    modules
) VALUES (
    '0.1.13',
    '2026-07-06T00:00:00+08:00',
    '邮件查询 API 与页面',
    '新增 v1 邮件查询 API，并提供邮件列表和邮件预览页面，同时保留旧 mail-api 路由兼容已有调用。',
    '[
        "新增 GET /v1/mail/messages、GET /v1/mail/messages/{id} 和 GET /v1/mail/search，作为邮件查询 API 的新地址。",
        "保留 GET /mail-api/messages、GET /mail-api/messages/{id} 和 GET /mail-api/search 兼容旧调用。",
        "新增 GET /mail 邮件列表页面，支持关键词、账户、邮箱目录、来源和分页查询。",
        "新增 GET /mail/messages/{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.6",
        "ias-service": "0.1.1",
        "ias-main": "0.1.13"
    }'::jsonb
) ON CONFLICT (version) DO UPDATE SET
    released_at = EXCLUDED.released_at,
    title = EXCLUDED.title,
    description = EXCLUDED.description,
    changes = EXCLUDED.changes,
    modules = EXCLUDED.modules;
