Refs #32962 -- Simplified NULL logic in BaseDatabaseSchemaEditor._iter_column_sql().
This commit is contained in:
parent
809c45ea3c
commit
fe074c96a3
@ -245,10 +245,10 @@ class BaseDatabaseSchemaEditor:
|
|||||||
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 and not self.connection.features.implied_column_null:
|
if not null:
|
||||||
yield 'NULL'
|
|
||||||
elif not null:
|
|
||||||
yield 'NOT NULL'
|
yield 'NOT NULL'
|
||||||
|
elif not self.connection.features.implied_column_null:
|
||||||
|
yield 'NULL'
|
||||||
if field.primary_key:
|
if field.primary_key:
|
||||||
yield 'PRIMARY KEY'
|
yield 'PRIMARY KEY'
|
||||||
elif field.unique:
|
elif field.unique:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user