This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
# ADR-0007:轻量幂等数据库迁移(非破坏性)
- **状态**:Accepted
## 背景
项目未引入 Alembic 可执行迁移链。
## 决策
启动时(lifespan)执行 `migrate_schema()`:查询 `information_schema` 判断列是否存在,仅对缺失列执行幂等 `ALTER TABLE`。只做“新增列”这类非破坏性变更。
## 后果
- 多实例/重复启动安全。
- 大规模结构变更缺少回放/回滚(见 OP-1 / OI-4)。
## 关联
DV-0010, NFR-7。