mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Fixed #31745 -- Added error messages when using UniqueConstraint.include/opclasses with deferrable.
This commit is contained in:
@@ -95,6 +95,14 @@ class UniqueConstraint(BaseConstraint):
|
||||
raise ValueError(
|
||||
'UniqueConstraint with conditions cannot be deferred.'
|
||||
)
|
||||
if include and deferrable:
|
||||
raise ValueError(
|
||||
'UniqueConstraint with include fields cannot be deferred.'
|
||||
)
|
||||
if opclasses and deferrable:
|
||||
raise ValueError(
|
||||
'UniqueConstraint with opclasses cannot be deferred.'
|
||||
)
|
||||
if not isinstance(deferrable, (type(None), Deferrable)):
|
||||
raise ValueError(
|
||||
'UniqueConstraint.deferrable must be a Deferrable instance.'
|
||||
|
||||
Reference in New Issue
Block a user