From 66d37e593c8fa22be226b34b4fc1f60f85dcdc26 Mon Sep 17 00:00:00 2001 From: Shai Berger Date: Wed, 18 Feb 2015 00:50:45 +0200 Subject: [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 --- django/db/backends/base/schema.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'django') diff --git a/django/db/backends/base/schema.py b/django/db/backends/base/schema.py index 00306d6803..d14f8919c0 100644 --- a/django/db/backends/base/schema.py +++ b/django/db/backends/base/schema.py @@ -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), -- cgit v1.3