summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2014-05-07 22:03:10 +0200
committerAymeric Augustin <aymeric.augustin@m4x.org>2014-05-08 22:11:20 +0200
commitcff59bedc23fd4d53557f677ddc42402b56963d0 (patch)
tree3ee14b070476d65b89fa0d5cdadb415e6710fa89 /django
parentc70a61eb49e4ed8f3b2a5011a7a5e6cda43c8598 (diff)
Split ignores_nulls_in_unique_constraints feature.
Oracle and SQL Server don't have exactly the same limitations. It's worth treating them differently.
Diffstat (limited to 'django')
-rw-r--r--django/db/backends/__init__.py9
-rw-r--r--django/db/backends/oracle/base.py2
2 files changed, 8 insertions, 3 deletions
diff --git a/django/db/backends/__init__.py b/django/db/backends/__init__.py
index a9bf3ea9cb..97e42d8f50 100644
--- a/django/db/backends/__init__.py
+++ b/django/db/backends/__init__.py
@@ -473,9 +473,14 @@ class BaseDatabaseFeatures(object):
# Does the backend distinguish between '' and None?
interprets_empty_strings_as_nulls = False
+ # Does the backend allow inserting duplicate NULL rows in a nullable
+ # unique field? All core backends implement this correctly, but other
+ # databases such as SQL Server do not.
+ supports_nullable_unique_constraints = True
+
# Does the backend allow inserting duplicate rows when a unique_together
- # constraint exists, but one of the unique_together columns is NULL?
- ignores_nulls_in_unique_constraints = True
+ # constraint exists and some fields are nullable but not all of them?
+ supports_partially_nullable_unique_constraints = True
can_use_chunked_reads = True
can_return_id_from_insert = False
diff --git a/django/db/backends/oracle/base.py b/django/db/backends/oracle/base.py
index e46b4f2db8..e53c8c9fb6 100644
--- a/django/db/backends/oracle/base.py
+++ b/django/db/backends/oracle/base.py
@@ -107,7 +107,7 @@ class DatabaseFeatures(BaseDatabaseFeatures):
has_zoneinfo_database = pytz is not None
supports_bitwise_or = False
can_defer_constraint_checks = True
- ignores_nulls_in_unique_constraints = False
+ supports_partially_nullable_unique_constraints = False
has_bulk_insert = True
supports_tablespaces = True
supports_sequence_reset = False