diff --git a/scripts/m11b2c_a3_patch_tx_write.py b/scripts/m11b2c_a3_patch_tx_write.py index 7ac5aa8..71537b3 100644 --- a/scripts/m11b2c_a3_patch_tx_write.py +++ b/scripts/m11b2c_a3_patch_tx_write.py @@ -53,13 +53,14 @@ def _has_db_default(fd): 写路径按语义不填它们;若计入必填集合,合法调用会被误报缺列。 (与 _recognize nullable 写法配套:只修识别不修默认值排除,事件表主链路会被误挡。) """ + if "default" not in fd: + return False dv = fd.get("default") if dv is None: return False - s = str(dv).strip() - if s == "" or s.upper() in ("NULL", "NONE"): + if str(dv).strip().upper() in ("NULL", "NONE"): return False - return True + return True # 含 DEFAULT ''(空串默认值同样是 DDL 默认值,数据库会补值) def required_columns(table):