Do not include WHERE clause to constraint if it is None

Closes #13315
This commit is contained in:
Cédric Krier committed 2024-06-09 01:45:21 +02:00
1 parent dfb3bc9337
commit 347a816156
1 file changed
+1 -1
+1 -1
View File
@@ -279,7 +279,7 @@ class TableHandler(TableHandlerInterface):
ident = self.convert_name(self.table_name + "_" + ident)
if database.has_constraint(constraint):
where = ''
if hasattr(constraint, 'where'):
if getattr(constraint, 'where', None):
where = ' WHERE ' + str(constraint.where)
cursor.execute(
'CREATE UNIQUE INDEX IF NOT EXISTS %s ON %s (%s) %s' % (