feat(db): 引入 Alembic 取代裸 DDL 迁移
- alembic init + env.py 接 settings/models metadata(asyncpg->psycopg2 同步 URL) - 补 3 个 CheckConstraint 到 models(原只在裸 DDL) - 离线生成初始迁移(31 表+约束+95 索引,全 sa.* 通用类型) - init_db 用 _run_alembic_migrations(自动基线+upgrade head)替换 create_tables+ensure_schema_updates(删 92 行裸 DDL) - 删破坏性 migrate_db.py(drop_all) - 既有 DB 首次启动自动 stamp 基线,无需手动 Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1 @@
|
||||
Generic single-database configuration.
|
||||
Reference in New Issue
Block a user