INSERT INTO ias_upgrade_logs (
    version,
    released_at,
    title,
    description,
    changes,
    modules
) VALUES (
    '0.2.27',
    '2026-07-08T00:00:00+08:00',
    '抽离数据库基础设施模块',
    '新增 ias-db 模块集中负责数据库连接和 SQLx 迁移执行，并将原 ias-service/migrations 整体迁移到 ias-db/migrations。',
    '[
        "新增 ias-db crate，集中负责 PostgreSQL 连接池创建、DATABASE_URL 读取和 SQLx 迁移执行。",
        "将原 ias-service/migrations 整体迁移到 ias-db/migrations，迁移嵌入和变更监听由 ias-db/build.rs 负责。",
        "ias-main 改为直接调用 ias_db::connect_db()，ias-service 只接收已建立的 PgPool 并运行服务，数据库生命周期边界更清晰。",
        "数据库无结构变化；已验证 cargo fmt --check 和 cargo check。"
    ]'::jsonb,
    '{
        "ias-common": "0.1.2",
        "ias-ai": "0.1.13",
        "ias-wechat": "0.1.1",
        "ias-context": "0.1.5",
        "ias-http": "0.1.14",
        "ias-mail": "0.1.15",
        "ias-db": "0.1.0",
        "ias-service": "0.1.24",
        "ias-main": "0.2.27"
    }'::jsonb
) ON CONFLICT (version) DO UPDATE SET
    released_at = EXCLUDED.released_at,
    title = EXCLUDED.title,
    description = EXCLUDED.description,
    changes = EXCLUDED.changes,
    modules = EXCLUDED.modules;
