Fix #250 -- Don't consider partial index creation as making a column not nullable.
This commit is contained in:
1 parent
b6acc1dd22
commit
97a1f5c6c9
3 files changed
+16
-1
No files matched your search
@@ -40,7 +40,8 @@ def has_not_null_column(sql_statements: list[str], **kwargs) -> bool:
|
||||
ends_with_default = False
|
||||
return (
|
||||
any(
|
||||
re.search("(?<!DROP )NOT NULL", sql) and not sql.startswith("CREATE TABLE")
|
||||
re.search("(?<!DROP )NOT NULL", sql)
|
||||
and not (sql.startswith("CREATE TABLE") or sql.startswith("CREATE INDEX"))
|
||||
for sql in sql_statements
|
||||
)
|
||||
and ends_with_default is False
|
||||
|
||||
Reference in new issue
Block a user