mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	Add feature for implied null (needed for Firebird backend)
This commit is contained in:
		| @@ -646,6 +646,9 @@ class BaseDatabaseFeatures(object): | |||||||
|     # Suffix for backends that don't support "SELECT xxx;" queries. |     # Suffix for backends that don't support "SELECT xxx;" queries. | ||||||
|     bare_select_suffix = '' |     bare_select_suffix = '' | ||||||
|  |  | ||||||
|  |     # If NULL is implied on columns without needing to be explicitly specified | ||||||
|  |     implied_column_null = False | ||||||
|  |  | ||||||
|     uppercases_column_names = True |     uppercases_column_names = True | ||||||
|  |  | ||||||
|     def __init__(self, connection): |     def __init__(self, connection): | ||||||
|   | |||||||
| @@ -132,9 +132,9 @@ class BaseDatabaseSchemaEditor(object): | |||||||
|         if (field.empty_strings_allowed and not field.primary_key and |         if (field.empty_strings_allowed and not field.primary_key and | ||||||
|                 self.connection.features.interprets_empty_strings_as_nulls): |                 self.connection.features.interprets_empty_strings_as_nulls): | ||||||
|             null = True |             null = True | ||||||
|         if null: |         if null and not self.connection.features.implied_column_null: | ||||||
|             sql += " NULL" |             sql += " NULL" | ||||||
|         else: |         elif not null: | ||||||
|             sql += " NOT NULL" |             sql += " NOT NULL" | ||||||
|         # Primary key/unique outputs |         # Primary key/unique outputs | ||||||
|         if field.primary_key: |         if field.primary_key: | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user