summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorShai Berger <shai@platonix.com>2015-02-18 00:50:45 +0200
committerShai Berger <shai@platonix.com>2015-02-19 02:44:08 +0200
commit66d37e593c8fa22be226b34b4fc1f60f85dcdc26 (patch)
tree35217077ad554d2e466a0cff5246fec18c4be14c /django
parente2a3be1e4d9a85aa30f1b7d9064b5abb1569eea6 (diff)
[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
Diffstat (limited to 'django')
-rw-r--r--django/db/backends/base/schema.py6
1 files changed, 5 insertions, 1 deletions
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),