Repository navigation
v1.1.1
Release v1.1.1
發布日期 (Date): 2026-05-01
主要亮點 (Highlights):
- 修正多張資料表有 FOREIGN KEY 互相依賴時,因字母排序導致建立順序錯誤而部署失敗的問題;同步修正含 schema 前綴的 INDEX 定義被誤判為需刪除的錯誤。
- EN: Fixed a deployment failure caused by alphabetical table ordering conflicting with FOREIGN KEY dependencies. Also fixed a false positive that incorrectly marked schema-prefixed index definitions (e.g.,
ON public."TableName") for deletion.
🌟 What's New / 主要更新
🚀 Features / 新功能
- 無 / None
🛠 Refactoring & Improvements / 重構與效能優化
- 無 / None
🐛 Bug Fixes / 問題修復
-
[修復] 含 FOREIGN KEY 的資料表因字母排序錯誤導致部署失敗
部署新資料表時,若多張表之間存在 FOREIGN KEY 約束(如EIP_DevOps_Commit_Repo參照EIP_DevOps_Commit),舊版依檔名字母順序執行,被引用的資料表可能在依賴者之後才建立,觸發42P01: relation "xxx" does not exist錯誤。
現於DeployOrchestrator.AnalyzeAsync中新增TopologicalSortTables()(Kahn 演算法),在進入 diff 前自動以 FK 依賴進行拓撲排序;若存在迴圈依賴則保留原始順序附加於末尾。EN: [Fix] Deployment failure when new tables have FOREIGN KEY dependencies with alphabetical ordering conflict
When deploying new tables with FOREIGN KEY constraints (e.g.,EIP_DevOps_Commit_ReporeferencesEIP_DevOps_Commit), the previous alphabetical file ordering could cause the referenced table to be created after its dependent, triggering42P01: relation "xxx" does not exist.
AddedTopologicalSortTables()(Kahn's algorithm) inDeployOrchestrator.AnalyzeAsync. Tables are now topologically sorted by FK dependency before the diff phase. Circular dependencies fall back to original order. -
[修復] 含 schema 前綴的 INDEX 定義被誤判為需刪除
SQL 檔案中使用ON public."TableName"(...)格式定義的索引,舊版IndexPatternregex 無法解析 schema 前綴,導致工具每次都誤判這些 INDEX 為「資料庫中有、但 SQL 定義中不存在」而產生DROP INDEX指令。
已將SqlFileParser.IndexPattern調整為支援可選的schema.前綴:ON\s+(?:[a-zA-Z_]\w*\.)?""([^""]+)""。EN: [Fix] Index definitions with schema prefix incorrectly flagged as extra indexes to drop
Index definitions using theON public."TableName"(...)format were not matched by the previousIndexPatternregex, causing the tool to incorrectly generateDROP INDEXstatements on every run for those indexes.
UpdatedSqlFileParser.IndexPatternto support an optionalschema.prefix:ON\s+(?:[a-zA-Z_]\w*\.)?""([^""]+)"".
⚠️ Breaking Changes / 重大變更
- 無 / None