Ignore 'IS NOT NULL' statements.
This commit is contained in:
1 parent
0ce5bd8f4b
commit
abb6233f44
2 files changed
+7
-1
No files matched your search
@@ -40,7 +40,7 @@ def has_not_null_column(sql_statements: list[str], **kwargs) -> bool:
|
||||
ends_with_default = False
|
||||
return (
|
||||
any(
|
||||
re.search("(?<!DROP )NOT NULL", sql)
|
||||
re.search("(?<!DROP )(?<!IS )NOT NULL", sql)
|
||||
and not (sql.startswith("CREATE TABLE") or sql.startswith("CREATE INDEX"))
|
||||
for sql in sql_statements
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user