Skip to content

v1.1.1

Choose a tag to compare

@lawrence8358 lawrence8358 released this 30 Apr 16:12
· 26 commits to main since this release
c6faf5e

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_Repo references EIP_DevOps_Commit), the previous alphabetical file ordering could cause the referenced table to be created after its dependent, triggering 42P01: relation "xxx" does not exist.
    Added TopologicalSortTables() (Kahn's algorithm) in DeployOrchestrator.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"(...) 格式定義的索引,舊版 IndexPattern regex 無法解析 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 the ON public."TableName"(...) format were not matched by the previous IndexPattern regex, causing the tool to incorrectly generate DROP INDEX statements on every run for those indexes.
    Updated SqlFileParser.IndexPattern to support an optional schema. prefix: ON\s+(?:[a-zA-Z_]\w*\.)?""([^""]+)"".

⚠️ Breaking Changes / 重大變更

  • 無 / None