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:
47
docs_v1.0/M4_workspace/2026-05-13_deploy_111614_response.md
Normal file
47
docs_v1.0/M4_workspace/2026-05-13_deploy_111614_response.md
Normal 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` 時只比對 version,skip 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 改逐檔 |
|
||||
Reference in New Issue
Block a user