You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
asyncdefensure_knowledge_schema(self):
stmts= [
"ALTER TABLE IF EXISTS knowledge_bases ADD COLUMN IF NOT EXISTS embedding_model_spec VARCHAR(512)",
...
"DELETE FROM api_keys WHERE user_id IS NULL",
...
]
asyncwithself.async_engine.begin() asconn:
forstmtinstmts:
awaitconn.execute(text(stmt))
问题:
无版本号、无回滚:语句含破坏性/不可逆操作(DELETE、ALTER SET NOT NULL、唯一索引重建),老数据升级失败无法回退;
Activity
xerrors commentedon Oct 23, 2026
已在
develop/0-8-0通过 Schema 初始化重构处理。建表和索引现在只由app-init在 PostgreSQL advisory lock 下执行,API 和 worker 启动时只做版本校验,不再并发执行手写 DDL;当前采用 fresh baseline + 版本表,不再支持历史库原地增量迁移。原 issue 建议的 Alembic up/down 没有采用,这是当前版本的明确取舍。此 Issue 现关闭。