diff options
| author | Chris Jerdonek <chris.jerdonek@gmail.com> | 2021-07-27 10:50:06 -0400 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2021-07-27 20:10:25 +0200 |
| commit | fe074c96a343530beea50fbdd0803d3e7b739e8e (patch) | |
| tree | 0e86dafc8f6605001779160d6b5f72f29a9ac935 /django | |
| parent | 809c45ea3c45deedd45e66955ac68ca6bb418e03 (diff) | |
Refs #32962 -- Simplified NULL logic in BaseDatabaseSchemaEditor._iter_column_sql().
Diffstat (limited to 'django')
| -rw-r--r-- | django/db/backends/base/schema.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/django/db/backends/base/schema.py b/django/db/backends/base/schema.py index 96182bed56..d117241fee 100644 --- a/django/db/backends/base/schema.py +++ b/django/db/backends/base/schema.py @@ -245,10 +245,10 @@ class BaseDatabaseSchemaEditor: if (field.empty_strings_allowed and not field.primary_key and self.connection.features.interprets_empty_strings_as_nulls): null = True - if null and not self.connection.features.implied_column_null: - yield 'NULL' - elif not null: + if not null: yield 'NOT NULL' + elif not self.connection.features.implied_column_null: + yield 'NULL' if field.primary_key: yield 'PRIMARY KEY' elif field.unique: |
