Commit Graph
8 Commits
Author SHA1 Message Date
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
Jesse_Chen 5957803de4 Merge GitHub upstream into Gitea primary 2026-08-05 11:13:34 +08:00
Jesse_Chen 53e04da7db fix(deploy): verify all retired staging migrations 2026-07-30 15:45:23 +08:00
Jesse_Chen 08c39cf949 fix(deploy): verify retired staging migration 2026-07-30 15:16:06 +08:00
Jesse_Chen a1b8eaec36 feat(staging): switch to local postgres 2026-07-22 11:04:36 +08:00
Jesse_Chen 3a9a332be0 fix: preserve staging rollback transition 2026-07-21 07:45:14 +08:00
Jesse_Chen 53d9aaf846 fix: enforce postgres least privilege 2026-07-21 07:45:14 +08:00
Jesse_Chen 69b38ee6ed feat: add reviewed postgres migration foundation 2026-07-21 07:45:14 +08:00