1
0
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:
Shai Berger
2015-02-18 00:50:45 +02:00
parent e2a3be1e4d
commit 66d37e593c
2 changed files with 37 additions and 2 deletions

View File

@@ -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),