topfans/backend/migrations
zerosaturation 89d5d12450 fix(task): backfill id=1/2 trigger_event + cleanup misleading NULL comments
daily_browse_asset (id=2) / daily_login (id=1) 之前永远不触发,根因:
2026_07_21_004 迁移只 backfill 了 id=3/4 的 trigger_event=task_key,
id=1/2 留 NULL。但 ProcessTaskEvent 引擎按 trigger_event = ? 严格匹配
(spec §4 单一隔离单元),NULL 不会命中,前端 reportEvent 后引擎跑空
循环、daily-tasks 任务永远 pending。

修复:
- 新增 2026_07_27_005 迁移:回填 id=1/2 的 trigger_event=task_key(幂等)
- 修订原 004 迁移的错误注释('trigger_event 留 NULL'误导后人)
- model/task_models.go:删除 'NULL 仍走 def.TaskKey 兜底' 不实承诺
- impl plan §37/39:修订错描述('暂不依赖 trigger_event 列')
- docker/init-db.sql:124668/124671:重建 dev DB 时也带 trigger_event
- daily_task_repo_test.go:补 2 个回归测试
  - NullTriggerEvent_NotMatched:trigger_event=NULL 时查不到
  - TriggerEventEqualsTaskKey_Matches:trigger_event=task_key 时能命中

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-27 16:36:40 +08:00
..
2026_06_08_001_statistic_events.sql
2026_06_08_002_statistic_mv_daily_user_income.sql
2026_06_08_003_statistic_mv_daily_exhibition_revenue.sql
2026_06_08_004_statistic_mv_daily_like_income.sql
2026_06_08_005_statistic_mv_asset_level_distribution.sql
2026_06_08_006_statistic_metric_weekly_user_income.sql
2026_06_08_007_statistic_metric_recent_level_ups.sql
2026_06_08_008_statistic_metric_upcoming_level_ups.sql
2026_06_08_009_statistic_refresh_log.sql
2026_06_08_010_statistic_partitions_initial.sql
2026_06_11_011_moderation_tables.sql
2026_06_16_001_create_notifications.sql
2026_06_22_012_activity_messages.sql
2026_06_25_001_share_events.sql
2026_07_08_001_app_download_configs.sql
2026_07_10_001_peripheral_mint.sql
2026_07_10_003_peripheral_info_code.sql
2026_07_10_004_peripheral_info_restructure.sql
2026_07_13_001_peripheral_info_verify_count.sql
2026_07_13_002_peripheral_info_reset_first_verified.sql
2026_07_21_001_exhibition_revenue_idempotent.sql fix(backend): financial correctness — settlement/hours/mint idempotency (batch 1) 2026-07-23 01:11:54 +08:00
2026_07_21_002_crystal_tx_source_id_unique.sql fix(backend): financial correctness — settlement/hours/mint idempotency (batch 1) 2026-07-23 01:11:54 +08:00
2026_07_21_003_exhibition_hours_idempotent.sql fix(backend): financial correctness — settlement/hours/mint idempotency (batch 1) 2026-07-23 01:11:54 +08:00
2026_07_21_004_daily_task_trigger.sql fix(task): backfill id=1/2 trigger_event + cleanup misleading NULL comments 2026-07-27 16:36:40 +08:00
2026_07_27_005_daily_task_browse_login_trigger.sql fix(task): backfill id=1/2 trigger_event + cleanup misleading NULL comments 2026-07-27 16:36:40 +08:00
20260713_add_mailbox_unread_counts.sql feat:增加邮箱管理功能 2026-07-14 21:59:15 +08:00
ai_chat.sql