fix NOT_NULL migration test to avoid catching "DROP NOT NULL"

This commit is contained in:
Viktor Danyliuk authored and David Wobrock committed 2019-07-29 21:05:12 +02:00
1 parent 5e2c7bbfaf
commit db3be19f64
1 file changed
+1 -1
+1 -1
View File
@@ -36,7 +36,7 @@ def has_default(sql, **kwargs):
migration_tests = (
{
"code": "NOT_NULL",
"fn": lambda sql, **kw: re.search("NOT NULL", sql)
"fn": lambda sql, **kw: re.search("(?<!DROP )NOT NULL", sql)
and not re.search("CREATE TABLE", sql),
"err_msg": "NOT NULL constraint on columns",
},