diff --git a/.trellis/workspace/zl-q/index.md b/.trellis/workspace/zl-q/index.md index adab2d4..bd3faaf 100644 --- a/.trellis/workspace/zl-q/index.md +++ b/.trellis/workspace/zl-q/index.md @@ -8,7 +8,7 @@ - **Active File**: `journal-1.md` -- **Total Sessions**: 2 +- **Total Sessions**: 3 - **Last Active**: 2026-04-16 @@ -19,7 +19,7 @@ | File | Lines | Status | |------|-------|--------| -| `journal-1.md` | ~156 | Active | +| `journal-1.md` | ~224 | Active | --- @@ -29,6 +29,7 @@ | # | Date | Title | Commits | |---|------|-------|---------| +| 3 | 2026-04-16 | 修复通知 targets 约束、合并注册脚本、路径缩短及清理重复索引 | `c79c773` | | 2 | 2026-04-16 | 新人初始礼包购买追踪功能实现 | `ff40ff9`, `fd0df28` | | 1 | 2026-04-16 | 新人初始礼包购买追踪功能 - 计划制定 | - | diff --git a/.trellis/workspace/zl-q/journal-1.md b/.trellis/workspace/zl-q/journal-1.md index 42ab684..cbe711f 100644 --- a/.trellis/workspace/zl-q/journal-1.md +++ b/.trellis/workspace/zl-q/journal-1.md @@ -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