1
0
mirror of https://github.com/django/django.git synced 2025-03-31 11:37:06 +00:00

Removed useless condition from Oracle's NullBooleanField's check constraint.

NULL cannot be compare with standard operators on Oracle, it works only
with IS NULL and IS NOT NULL operators. Therefore 'OR ... IS NULL'
condition in NullBooleanField's check constraint is redundant.
Nullability is checked in a separate constraint.
This commit is contained in:
Mariusz Felisiak 2017-09-05 11:17:06 +02:00 committed by GitHub
parent 3ba4de59a2
commit 179b247e07

View File

@ -111,7 +111,7 @@ class DatabaseWrapper(BaseDatabaseWrapper):
}
data_type_check_constraints = {
'BooleanField': '%(qn_column)s IN (0,1)',
'NullBooleanField': '(%(qn_column)s IN (0,1)) OR (%(qn_column)s IS NULL)',
'NullBooleanField': '%(qn_column)s IN (0,1)',
'PositiveIntegerField': '%(qn_column)s >= 0',
'PositiveSmallIntegerField': '%(qn_column)s >= 0',
}