summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Godwin <andrew@aeracode.org>2014-05-20 13:27:07 +0100
committerAndrew Godwin <andrew@aeracode.org>2014-05-20 13:27:07 +0100
commit1b07781292c2cef9367b521dc0f2b40f4d363083 (patch)
tree0494b3d0de8e01742cde873387a7d68e2d38289b
parenta4737bf6ae36a5f1cb29f2232f6deeff084fabff (diff)
Add feature for implied null (needed for Firebird backend)
-rw-r--r--django/db/backends/__init__.py3
-rw-r--r--django/db/backends/schema.py4
2 files changed, 5 insertions, 2 deletions
diff --git a/django/db/backends/__init__.py b/django/db/backends/__init__.py
index dfc967e60a..1b12a41caf 100644
--- a/django/db/backends/__init__.py
+++ b/django/db/backends/__init__.py
@@ -646,6 +646,9 @@ class BaseDatabaseFeatures(object):
# Suffix for backends that don't support "SELECT xxx;" queries.
bare_select_suffix = ''
+ # If NULL is implied on columns without needing to be explicitly specified
+ implied_column_null = False
+
uppercases_column_names = True
def __init__(self, connection):
diff --git a/django/db/backends/schema.py b/django/db/backends/schema.py
index 2a62803a73..dcf3ad544b 100644
--- a/django/db/backends/schema.py
+++ b/django/db/backends/schema.py
@@ -132,9 +132,9 @@ class BaseDatabaseSchemaEditor(object):
if (field.empty_strings_allowed and not field.primary_key and
self.connection.features.interprets_empty_strings_as_nulls):
null = True
- if null:
+ if null and not self.connection.features.implied_column_null:
sql += " NULL"
- else:
+ elif not null:
sql += " NOT NULL"
# Primary key/unique outputs
if field.primary_key: