chore(db): PostgreSQL 迁移统一分支 - #299
Conversation
✅ PostgreSQL access/session validation passedValidated branch:
|
❌ PostgreSQL unified validation failedValidated branch:
Full diagnostic log is attached to the workflow run artifact. |
❌ PostgreSQL unified validation failedValidated branch:
Full diagnostic log is attached to the workflow run artifact. |
|
/validate-pg-unified |
❌ PostgreSQL unified validation failedValidated branch:
Full diagnostic log is attached to the workflow run artifact. |
|
/validate-pg-unified |
✅ PostgreSQL unified validation passedValidated branch:
Full diagnostic log is attached to the workflow run artifact. |
|
/validate-pg-unified |
✅ PostgreSQL unified validation passedValidated branch:
Full diagnostic log is attached to the workflow run artifact. |
|
/validate-pg-unified-batch-b |
✅ PostgreSQL Batch B validation passedValidated branch:
|
|
/validate-pg-unified-batch-b |
|
/validate-pg-unified-batch-b-final |
✅ PostgreSQL Batch B validation passedValidated branch:
|
#249 Batch B 已落地最终 Head: 本轮直接在
最终验证全部通过:npm ci、TypeScript、SQLite direct-access audit、PostgreSQL schema parity、Runtime/SQL dialect、完整 SQLite 回归、真实 PostgreSQL 回归、生产 backend bundle。 一次性验证工作流已从 |
|
/validate-pg-permissions |
2 similar comments
|
/validate-pg-permissions |
|
/validate-pg-permissions |
|
本轮已直接在 |
|
/validate-pg-access-session |
2 similar comments
|
/validate-pg-access-session |
|
/validate-pg-access-session |
目的
所有未完成的 PostgreSQL 迁移统一在
pg-migration-unified推进。PR 继续保持 Draft;当前仍为 PostgreSQL runtime-only,不宣称整个项目已可生产切换。businessRoutesReady = false最新代码基线
main@69b277133fe5aeae0e7b9d9dc8c6960373467c61release/v1.4.6@243438d6dfcefa80b0ca07a0a58d7a1e3b4b4708pg-migration-unified@93aeff98c369ca0b187056e3754ab951d99c6449release/v1.4.6 behind_by = 0、ahead_by = 910发布代码使用 merge commit 同步,不 rebase、不 force push:
068b12156427a591e7a00bb1a351ec354ee690ea45151003f2f00aa6bc3af978411a758659e517a65fc16ab0dbb835cc3b583246e50186835665fc02本轮同步包含冲突副本/草稿安全、latest-only save queue、note sync review、图片导出修复脚本与 Android 发版断言调整。
已完成的 PostgreSQL Runtime
Notes
已覆盖列表、详情、创建、更新、移动、排序、回收站、恢复、永久删除及删除副作用。
Knowledge Tree
已覆盖 scope listing、shared roots、创建、更新、移动、排序、删除、恢复、权限、历史、文件夹密码与 unlock。
Note Transfer(#249)
对应 immutable migrations:
0016~0022。SQLite → PostgreSQL 数据迁移(#251)
第一切片:预检与持久化基础
674955842029a00388e5fccd62150433f0d36bf20023_sqlite_postgres_migration_runs.sql覆盖只读 source inspection、备份一致性、目标 schema/非空检查、依赖排序、幂等计划、table/batch checkpoint、lease 与 expired lease takeover。
第二切片:可恢复复制与独立校验
108885a3ac7aa575de5d25dafd1f9a6cf764e8e3覆盖冻结备份、主键 keyset cursor、事务化 upsert/checkpoint、restart/resume、类型转换、自引用修复、identity sequence、checksum、copy-time verify 与 independent verify。
第三切片:run-owned tracking 与空目标 rollback
ac8324698c2a766eba706bda8ce37a9fb5b245c00024_sqlite_postgres_migration_rollback.sql覆盖 run-owned table/primary-key 记录、反向依赖 rollback、bounded interruption/resume、残留验证与幂等 replay。
第四切片:非空目标冲突与原值恢复
cbe6be01b3c46c25a0f2fa1b0bb9e9eca8ed79430025_sqlite_postgres_nonempty_recovery.sql覆盖
abort/overwrite-with-backup冲突策略、inserted / updated / unchanged分类、类型安全originalRow、精确migratedRow、非空目标 verify、updated 恢复与迁移后并发修改保护。第五切片:规模化演练与最终报告
93aeff98c369ca0b187056e3754ab951d99c6449完整演练链路:
新增:
reportDrill CLI:
DATABASE_URL='postgres://...' \ npm run migrate:sqlite-to-postgres:drill -- \ --source /path/to/nowen-note.db \ --backup /path/to/nowen-note.backup.db \ --idempotency-key drill-2026-08-06 \ --batch-size 200 \ --max-batches-per-pass 10 \ --max-rollback-batches-per-pass 10 \ --report /secure/path/report.json非空目标仍必须显式使用:
相关验证
30987878300/3098819515930990596984/3099080797130995951482/3099608177231015699237/31015931968/3101606088731063726993/ Job92496940323/success31064027454/ Job92497841936/success覆盖 PostgreSQL 16、TypeScript、Direct DB Audit、schema parity、migrations
0001~0025、空/非空目标 apply/verify/rollback、类型恢复、并发修改保护、失败注入、中/大型演练、两个 CLI contract 与 production bundle。这里只确认相关 PostgreSQL 专用门禁,不宣称全仓所有无关历史 CI 均已完成。
#251 当前判断
迁移引擎的代码范围已基本覆盖:
#251 暂时保持打开,等待真实 staging 数据演练证据归档或维护者确认正式收口。
为什么仍不能生产切换
仍依赖:
原始 SQLite 和冻结备份必须保留到迁移验证通过、rollback window 关闭且 PostgreSQL 备份完成独立恢复验证。
下一阶段
从 #251 的迁移引擎开发转入 #252:
PR 继续保持 Draft。