mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
[1.8.x] Fixed #24307: Avoided redundant column nullability modifications on Oracle
Thanks Joris Benschop for the report, and Tim Graham for the tests.
Backport of ceadc94f09 from master
This commit is contained in:
@@ -593,7 +593,11 @@ class BaseDatabaseSchemaEditor(object):
|
||||
))
|
||||
# Nullability change?
|
||||
if old_field.null != new_field.null:
|
||||
if new_field.null:
|
||||
if (self.connection.features.interprets_empty_strings_as_nulls and
|
||||
new_field.get_internal_type() in ("CharField", "TextField")):
|
||||
# The field is nullable in the database anyway, leave it alone
|
||||
pass
|
||||
elif new_field.null:
|
||||
null_actions.append((
|
||||
self.sql_alter_column_null % {
|
||||
"column": self.quote_name(new_field.column),
|
||||
|
||||
Reference in New Issue
Block a user