[1.7.x] Added feature for implied null (needed for Firebird backend)

Backport of 1b07781292 from master
This commit is contained in:
Tim Graham 2014-06-19 11:02:53 -04:00
parent 427f218a5e
commit 30d8b95139
2 changed files with 5 additions and 2 deletions

View File

@ -750,6 +750,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 = False
def __init__(self, connection):

View File

@ -133,9 +133,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: