Do not lock table on SQLite when checking unsupported constraint

It is not needed as SQLite does not have an explicit lock mechanism but such
call restart the transaction anyway.
This commit is contained in:
Cédric Krier
2025-04-27 17:20:45 +02:00
parent b85d6e9efa
commit 2e1d79d050
+2 -1
View File
@@ -2187,7 +2187,8 @@ class ModelSQL(ModelStorage):
continue
table = sql.table
if isinstance(sql, (Unique, Exclude)):
cls.lock()
if backend.name != 'sqlite':
cls.lock()
if not database.has_range():
columns = []
for col in sql.columns: