chore(db): 将 108–115 补丁迁移收敛为 108–111

- 原 108/111/112/113/114 合并为 108_finance_cost_integrity:
  成本异常归档、人工成本完整性、影子总账、商品页/模板查询索引
- 原 115 注释迁移改为 111_work_order_share_cancel_reason_comment
- 新增 reconcile-migration-history.sql,用于已跑旧 112–115 的库
  重建 schema_migrations 顺序,不重复执行 DDL
- 已验证:001→111、101→111 两条升级路径;
  旧 115 与新 111 的 pg_dump schema 完全一致
- 测试/文档迁移编号同步到 103–111

验证:backend check 853(849 pass / 4 skip);frontend check 172 + build。
This commit is contained in:
yml2213
2026-10-27 12:37:21 +08:00
parent e686a77a9e
commit 0de0fd7b58
19 changed files with 394 additions and 360 deletions
@@ -127,9 +127,9 @@ test('人工成本缺失必须进入异常队列,且只监控首次配置之
)
})
test('迁移 111 提供订单项级人工成本唯一约束与 subject 语义约束', async () => {
test('迁移 108 提供订单项级人工成本唯一约束与 subject 语义约束', async () => {
const source = await readFile(
new URL('../../db/migrations/111_manual_cost_integrity.sql', import.meta.url),
new URL('../../db/migrations/108_finance_cost_integrity.sql', import.meta.url),
'utf8',
)
assert.ok(source.includes('uq_cost_snapshots_manual_order_item'), '缺少订单项级人工快照唯一索引')
@@ -146,7 +146,10 @@ test('迁移 111 提供订单项级人工成本唯一约束与 subject 语义约
test('总账/对账/关账/平台退款能力已接入', async () => {
const [migration, ledger, reconciliation, refund, manual] = await Promise.all([
readFile(new URL('../../db/migrations/112_finance_ledger.sql', import.meta.url), 'utf8'),
readFile(
new URL('../../db/migrations/108_finance_cost_integrity.sql', import.meta.url),
'utf8',
),
readFile(new URL('./finance-ledger-service.ts', import.meta.url), 'utf8'),
readFile(new URL('./finance-reconciliation-service.ts', import.meta.url), 'utf8'),
readFile(new URL('./order-refund-service.ts', import.meta.url), 'utf8'),