Don't consider partial unique index creation as making a column not nullable.

This commit is contained in:
Deven Dayal authored and David Wobrock committed 2024-03-30 11:48:49 +01:00
1 parent b15924ca0f
commit a230681de5
3 files changed
+8 -1

No files matched your search

@@ -37,7 +37,9 @@ def has_not_null_column(sql_statements: list[str], **kwargs) -> bool:
for sql in sql_statements:
if re.search("(?<!DROP )(?<!IS )NOT NULL", sql) and not (
sql.startswith("CREATE TABLE") or sql.startswith("CREATE INDEX")
sql.startswith("CREATE TABLE")
or sql.startswith("CREATE INDEX")
or sql.startswith("CREATE UNIQUE INDEX")
):
not_null_column = True
if re.search("DEFAULT.*NOT NULL", sql):