forked from wangziqi/gongxue-base
feat: harden pocketbase migration readiness checks
This commit is contained in:
20
README.md
20
README.md
@@ -279,6 +279,26 @@ npm run pb:import:dry-run -- --json
|
||||
|
||||
dry-run 会检查导出目录、JSON 形态、核心集合缺失、重复/缺失旧 ID、敏感字段、旧 schema 关系断裂和未映射集合。存在 blocker 时命令返回非 0;所有 blocker 处理完后,再执行 `npm run pb:import:json` 和 `npm run pb:import:validate`。
|
||||
|
||||
真实生产数据迁移不要只看命令是否能跑完,需要按迁移验收 runbook 执行 dry-run、正式导入演练、导入后校验、业务抽样、Taro 联调、冻结切换和回滚准备:
|
||||
|
||||
```text
|
||||
docs/refactor/pocketbase-real-data-migration-runbook.md
|
||||
```
|
||||
|
||||
正式切换前建议使用严格模式:
|
||||
|
||||
```bash
|
||||
npm run pb:import:dry-run -- --json --fail-on-warnings
|
||||
```
|
||||
|
||||
导入后校验建议在预生产/生产切换前把 warning 也作为阻断:
|
||||
|
||||
```powershell
|
||||
$env:FAIL_ON_WARNINGS="true"
|
||||
npm run pb:import:validate
|
||||
Remove-Item Env:\FAIL_ON_WARNINGS
|
||||
```
|
||||
|
||||
## API 模块
|
||||
|
||||
当前 API 目录:
|
||||
|
||||
Reference in New Issue
Block a user