
JianMiauandClaude Fable 5
db67c19e85
自動放寬舊資料表過小的欄位,修正上傳失敗
根本原因:
badminton 資料表是舊系統先建立的,battlecombination 欄位型別比 TEXT 小;ensureTable 的 CREATE TABLE IF NOT EXISTS 對已存在的資料表不會生效,跨區平衡後 6 隊 × 3 輪的 JSON 超過欄位長度,寫入時噴出「Data too long for column 'battlecombination'」。
影響:
- server 啟動後第一次資料庫操作會自動把 personnel 與 battlecombination 放寬成 TEXT,不需手動下 SQL
- ensureTable 加上 tableReady 旗標,每個 process 只檢查一次,不再每個 request 都跑 CREATE TABLE
修法:
新增 widenLegacyColumns 查詢 information_schema,欄位型別不是 TEXT 系列時執行 ALTER TABLE MODIFY 放寬,並以模組層旗標記憶檢查結果。
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>