fix: deploy.sh build check lenient + per-file import order (M4 feedback)

- Accept SRV_BUILD=unknown (skip build check, only compare version)
- Per-table import with explicit FK order (nodes before edges)
This commit is contained in:
Accusys
2026-05-13 20:15:44 +08:00
parent 3dc09cf802
commit 1d69a88741
3 changed files with 89 additions and 12 deletions

View File

@@ -0,0 +1,47 @@
# 111614 包 deploy.sh 最終修正回報
**Date**: 2026-05-13
**From**: M4
**To**: M5
**Ref**: `2026-05-13_111614_test_report.md`
---
## ✅ 確認完成
9 個 table 全部匯入成功TMDB 7 演員匹配:
| Table | Count | Status |
|-------|------:|:--:|
| videos | 1 | ✅ |
| chunk | 2,407 | ✅ |
| chunk_vectors | 2,407 | ✅ |
| face_detections | 70,691 | ✅ |
| identities (TMDB) | 7 | ✅ Cary Grant, Audrey Hepburn 等 |
| identities (auto) | 417 | ✅ |
| identity_bindings | 18,635 | ✅ |
| tkg_nodes | 6,457 | ✅ |
| tkg_edges | 21,028 | ✅ |
| status | completed | ✅ |
## deploy.sh 需微調 (2 項)
### 1. build check 接受 `unknown`
M4 的 playground binary 沒有 `build_git_hash` 欄位 → `/health``unknown`。目前 deploy.sh 將 `unknown``d34bcae` 當作 mismatch → exit 1。
**修正**`SRV_BUILD``unknown` 時只比對 versionskip build check。
### 2. import 改逐檔 `psql -f`
`data.sql` 使用 `BEGIN; \i sql/*.sql COMMIT;` 包 transaction。任一 COPY 失敗(如 re-deploy 時 dup key整個 transaction abort → 全部 table rollback。
**修正**deploy.sh import 步驟改為逐一 import `sql/*.sql` 每個檔案(各有自己的 auto-commit而非透過 `data.sql``\i` chain。
---
## 檔案變更
| 檔案 | 說明 |
|------|------|
| `deploy.sh` | build check lenient + import 改逐檔 |