Permalink
Browse files

Add feature for implied null (needed for Firebird backend)

  • Loading branch information...
andrewgodwin committed May 20, 2014
1 parent a4737bf commit 1b07781292c2cef9367b521dc0f2b40f4d363083
Showing with 5 additions and 2 deletions.
  1. +3 −0 django/db/backends/__init__.py
  2. +2 −2 django/db/backends/schema.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):
@@ -132,9 +132,9 @@ def column_sql(self, model, field, include_default=False):
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:

0 comments on commit 1b07781

Please sign in to comment.