fix: 为所有 ORM 模型添加外键约束及级联删除策略 #65
Reference in New Issue
Block a user
Delete Branch "fix/database-foreign-key-constraints"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
变更内容
ORM 模型外键约束 (Task #17)
为所有 SQLAlchemy ORM 模型添加完整的 ForeignKey 约束和 relationship 定义:
Pydantic 响应模型更新
将可能为 NULL 的响应字段从 str 改为 str | None,兼容 Pydantic v2
Alembic 迁移
新增 010_add_foreign_key_constraints.py,包含完整的 upgrade/downgrade