-
编码期测试的 DB 时序从「DROP+CREATE 空库 → Flyway 从零重建 → seed」 改为「mysqldump 复制源库→一次性副本 → Flyway 只 apply 本轮新迁移 → 跑测试 → 绿后晋升新迁移到源库 → 无论红绿删副本」。 - 新模板 scripts/drop-test-db.mjs(删副本,硬拒删源库)、 scripts/promote-to-source.mjs(移植 flyway 历史行+重放迁移到源库; 跨 lane 串行由编排层 testGate 起栈互斥保证,文件锁兜底同树重跑) - setup-test-db:DROP 空库 → 复制源库到副本;test.mjs:try/finally 删副本 + 绿后晋升 + 串行缺省显式导出副本名 <schema>__test - 命名约定(5 脚本共享):COPY = env > marker > <source>__test, 每脚本 COPY===SOURCE 即拒绝;application*.yml 占位缺省改为副本名 - 新 lib/bootstrap-source-flyway.mjs:db-init 建源库+apply V1+写 checksum 与 Flyway 一致的历史行(Plan 期无 app 可起,手算 CRC32); db-init B 段三步换一次 bootstrap 调用 - coding.mjs 各闸时序对齐;globalTeardown 只 kill 不删副本(teardown 删副本会让其后的 promote 查不到副本历史而静默跳过晋升);行为门/ seed 契约允许清单补 drop-test-db;前端 testGate 补收尾删副本 - 模板测试重写 + 新增 drop/promote/bootstrap 测试(133 全绿,全离线) 已知残留:bootstrap 手算 Flyway checksum 未真机验证(若不一致首次 起后端报 checksum mismatch,改 flywayChecksum 一处即可);演示种子 固定主键区间 1000–9999 与源库真实自增数据增长存在长期碰撞风险。
-
与 setup-test-db 模板建库字符集保持一致。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
-
…yml 占位约定 + Flyway out-of-order;env/marker 双缺省行为一字不变
-
- coding.mjs: per-module Seed stage after backend testGate (generate sql/seed/NN__<module>.sql, cold-stack verify with PK-range COUNT reconciliation); behavior gate step2 -> 5-step ordering (demo seed before sentinel, sentinel fixed >=100000 range); fe-skeleton adds Playwright globalSetup e2e baseline (seed + admin storageState); fe tdd e2e assertion constraints - skeleton-gen: new scripts-seed-demo-data-template.mjs (mysql CLI, _demo_seed_history idempotency ledger, offline-validatable, atomic apply+ledger batch) + lib offline tests (93/93 green) - db-init: B.3 re-clean DB after DDL smoke apply (hand schema back to Flyway, avoid missing-history-table error); fix step-D typo - docs-04/CLAUDE templates: data baseline & demo-seed conventions (PK ranges 1-999 init / 1000-9999 seed / >=100000 sentinel)