Files
awoooi/apps/api
OG T 4e2e6652e3
All checks were successful
CD Pipeline / build-and-deploy (push) Successful in 14m50s
fix(db): 移除 IncidentEvidence.incident_id 的重複 index 定義
根本原因:incident_id 同時設定 index=True(mapped_column)
與 __table_args__ 中的 Index("ix_incident_evidence_incident_id"),
導致 table.create 生成重複的 CREATE INDEX,
觸發 "already exists" 被靜默捕捉,整個 CREATE TABLE transaction 回滾。
直接效果:Pod 啟動時 incident_evidence 表永遠不會被建立,
導致後續 ALTER TABLE 失敗 → CrashLoopBackOff。

修法:移除 mapped_column 中的 index=True,
索引由 __table_args__ 統一管理。

注意:已在 PostgreSQL 直接建立 incident_evidence 表解除 CrashLoop。

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-15 16:13:18 +08:00
..