fix(ci): harden migration workflow audit
All checks were successful
Code Review / ai-code-review (push) Successful in 11s
All checks were successful
Code Review / ai-code-review (push) Successful in 11s
This commit is contained in:
@@ -6307,6 +6307,29 @@ RLS app context:
|
||||
project_context=awoooi total=312 redacted_total=0 envelope_total=0
|
||||
```
|
||||
|
||||
**Migration CI 紅燈修正**:
|
||||
|
||||
- 首次推版後 `run-migration.yml` run `1914` 失敗在 `Seed asset_discovery_run (audit)`:
|
||||
- `psql -c` 不展開 `:'commit_sha'` / `:'files_json'` 變數,造成 syntax error。
|
||||
- 同一 workflow 也把 `_down.sql` 當新增 migration 套用,導致 up migration 後又被 rollback。
|
||||
- 已手動確認 production 欄位曾被 `_down.sql` 移除,並立即重新套回 up migration。
|
||||
- workflow 修正:
|
||||
- `Identify new migrations` 跳過 `*_down.sql` / `*rollback.sql`。
|
||||
- audit SQL 改用 heredoc 餵給 `psql`,讓 `-v` 變數正常展開。
|
||||
|
||||
```text
|
||||
ruby YAML.load_file(".gitea/workflows/run-migration.yml")
|
||||
# yaml ok
|
||||
|
||||
bash -n Identify new migrations / Seed asset_discovery_run extracted scripts
|
||||
# bash syntax ok
|
||||
|
||||
Identify new migrations local dry-run:
|
||||
apps/api/migrations/awooop_phase7_outbound_truth_chain_columns_2026-05-12.sql
|
||||
Rollback/down migrations skipped:
|
||||
apps/api/migrations/awooop_phase7_outbound_truth_chain_columns_2026-05-12_down.sql
|
||||
```
|
||||
|
||||
**下一步**:
|
||||
|
||||
- 推 Gitea main,讓 API image 部署 T1 程式碼。
|
||||
|
||||
Reference in New Issue
Block a user