
Jesse_ChenandClaude Opus 5
d6c359b205
fix(db): 把校正标题/活跃时间修补搬成迁移
BUG-699 / BUG-704 的数据修补原先只存在于
frontend/scripts/repair-rectification-session-titles.mjs,需要
SCHEMA_DATABASE_URL 才能跑,产品负责人没有任何按钮能执行它,所以那批
错日期的会话标题一直没修。
脚本里本来就是纯 SQL,搬进一次性迁移即可复用现成的
`Migrate Staging Database` 按钮:
- 新增 20260916020000_rectification_session_title_repair.sql,两段 update
逐字取自脚本(合同测试比对,改了哪边都会红);权限守卫沿用
20260915010000 的 schema_owner 写法。
- 幂等:改完之后两段 where 都不再匹配同一行,重复应用影响 0 行。
- 各自 get diagnostics + raise notice 打出行数;db-migrate.mjs 加 notice
转发,否则 node-postgres 会把 NOTICE 丢掉,迁移日志里一个数字都看不到。
- 脚本降级为只读核对工具:--apply 改为报错并指向迁移;导入不再连库。
生产停在 7b620c7a(没有 use-rectification-surface.ts,标题固定且不写库),
两段 where 自然匹配 0 行,是预期内的 no-op。
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JUei7K13cYxLHE3Axe4A45
2026-09-16 01:35:01 +00:00
..
2026-09-16 01:35:01 +00:00
2026-08-29 03:39:43 +08:00
2026-09-02 04:29:01 +00:00
2026-07-21 17:52:25 +08:00
2026-08-10 04:19:24 +08:00
2026-07-16 11:02:33 +08:00
2026-08-30 15:55:45 +08:00
2026-09-16 01:35:01 +00:00
2026-08-06 19:18:04 +08:00