Fix #250 -- Don't consider partial index creation as making a column not nullable.

This commit is contained in:
David Wobrock authored and David Wobrock committed 2023-07-03 20:41:03 +02:00
1 parent b6acc1dd22
commit 97a1f5c6c9
3 files changed
+16 -1

No files matched your search

+2 -1
View File
@@ -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