diff options
| author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2021-09-01 13:26:46 +0200 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2021-09-01 20:54:12 +0200 |
| commit | 338fc0e7f10f7ca781b059f2ff46e1a1a85c91f8 (patch) | |
| tree | fbeb41ab0e5eeb54494e19c3528b9505f0caba88 /django | |
| parent | f65eb4664603fd66d638b78c670da12b00f6b907 (diff) | |
Fixed #33080 -- Preserved nullability of textual fields on Oracle.
Thanks Matt Hoskins for the report.
Diffstat (limited to 'django')
| -rw-r--r-- | django/db/backends/base/schema.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/django/db/backends/base/schema.py b/django/db/backends/base/schema.py index 15ccda52e2..896ea3d517 100644 --- a/django/db/backends/base/schema.py +++ b/django/db/backends/base/schema.py @@ -880,8 +880,10 @@ class BaseDatabaseSchemaEditor: Return a (sql, params) fragment to set a column to null or non-null as required by new_field, or None if no changes are required. """ - if (self.connection.features.interprets_empty_strings_as_nulls and - new_field.get_internal_type() in ("CharField", "TextField")): + if ( + self.connection.features.interprets_empty_strings_as_nulls and + new_field.empty_strings_allowed + ): # The field is nullable in the database anyway, leave it alone. return else: |
