chore: record journal

This commit is contained in:
qzl
2026-04-16 17:53:16 +08:00
parent c79c773d67
commit be30eb6eab
2 changed files with 71 additions and 2 deletions
+68
View File
@@ -154,3 +154,71 @@
### Next Steps
- None - task complete
## Session 3: 修复通知 targets 约束、合并注册脚本、路径缩短及清理重复索引
**Date**: 2026-04-16
**Task**: 修复通知 targets 约束、合并注册脚本、路径缩短及清理重复索引
### Summary
(Add summary)
### Main Changes
## 完成的四项任务
| 任务 | 描述 |
|------|------|
| 重复索引清理 | 创建 Alembic migration drop `ix_llm_factory_name``ix_llms_model_code` |
| 脚本合并 | `register-notifications.sh` 合并到 `dev-migrate.sh sync-notifications` 子命令 |
| 路径缩短 | `static/notification/notifications/``static/notifications/` |
| Targets 语义约束 | `NotificationTargetMode` 枚举 + 注册流程按 target_mode 分发通知 |
## 关键变更
| 模块 | 变更 |
|------|------|
| 枚举 | `NotificationTargetMode` (new_users/exist_users/all_users/user_ids) |
| ORM | `Notification.target_mode` VARCHAR + CHECK constraint |
| 注册流程 | `RegisterBonusResult.is_first_registration` 区分首次注册 |
| 通知分发 | `link_notifications_for_registered_user` 按 target_mode 过滤 |
| YAML | `welcome_points.yaml` mode 改为 `new_users` |
| 死代码 | 删除 `link_published_notifications_to_user` |
## 数据库 Migration
- `20260416_0002_drop_duplicate_llm_indexes.py` - 清理重复索引
- `20260416_0003_add_notification_target_mode.py` - 添加 target_mode 列
## 测试
- 44 个单元测试
- 1 个集成测试 (注册 + 重新注册通知分发)
- 全部通过
## 文件统计
- 26 files changed
- +1011 insertions
- -49 deletions
### Git Commits
| Hash | Message |
|------|---------|
| `c79c773` | (see git log) |
### Testing
- [OK] (Add test results)
### Status
[OK] **Completed**
### Next Steps
- None - task complete