docs: update dev status log for round 4 - propose model + DB migration
This commit is contained in:
@@ -102,6 +102,38 @@
|
||||
- P1.5 数据库迁移骨架:编写 SQL 迁移脚本处理 MySQL enum 列 ALTER + 旧数据映射(milestone: pending→open, deferred→closed, progressing→undergoing; task: progressing→undergoing)
|
||||
- 或 P1.3 Propose 模型新增(后端新建 propose model + schema)
|
||||
|
||||
### 2026-03-17 02:00 UTC(第 4 轮:Propose 模型 + DB 枚举迁移脚本)
|
||||
|
||||
本轮做了什么:
|
||||
- 新建 Propose 后端模型(P1.3):`app/models/propose.py`,包含 `ProposeStatus` 枚举(open/accepted/rejected)和完整字段(propose_code, title, description, status, project_id, created_by_id, feat_task_id, timestamps)
|
||||
- 新增 Propose Pydantic schemas(P1.3):`ProposeStatusEnum`、`ProposeCreate`、`ProposeUpdate`、`ProposeResponse`,`feat_task_id` 仅在 Response 中输出(只读)
|
||||
- 编写 MySQL 枚举迁移脚本(P1.5):在 `main.py` 的 `_migrate_schema()` 中新增:
|
||||
- milestone status 列:先扩宽 ENUM 接受新旧值 → UPDATE 旧值映射 → 收缩为新枚举
|
||||
- task status 列:同样三步迁移(progressing→undergoing)
|
||||
- milestones 表 `started_at` 列自动添加
|
||||
- 在 startup 的 `create_all` 引入 propose model,新部署会自动建表
|
||||
|
||||
改了哪些关键文件:
|
||||
- `HarborForge.Backend/app/models/propose.py` — 新增
|
||||
- `HarborForge.Backend/app/schemas/schemas.py` — 新增 Propose schemas
|
||||
- `HarborForge.Backend/app/main.py` — import propose + 枚举迁移 SQL
|
||||
|
||||
验证结果:
|
||||
- 3 个文件 Python AST 语法检查全部通过
|
||||
- 前端 `tsc --noEmit` 零错误(无回归)
|
||||
- 后端无旧枚举残留(grep 确认)
|
||||
- 已 commit: backend `2bea75e`, parent `7afa8cd`
|
||||
|
||||
当前阻塞/风险:
|
||||
- 无本地 MySQL 环境,枚举迁移 SQL 未做实际 DB 验证
|
||||
- Propose CRUD router 尚未创建(P6.1)
|
||||
- Propose 编码生成逻辑(P1.4 `{proj_code}:P{i:05x}`)尚未实现
|
||||
- 前端 Propose 类型定义和页面尚未开始
|
||||
|
||||
下一轮最建议继续做什么:
|
||||
- P6.1 Propose 基础 CRUD router(create/list/get/update),含 propose_code 自动生成
|
||||
- 这是让 Propose 功能可用的最小后端闭环
|
||||
|
||||
---
|
||||
|
||||
## 1. 背景
|
||||
|
||||
Reference in New Issue
Block a user