Skip to content

Commit

Permalink
Fixed problem introduced with #refs 13711.
Browse files Browse the repository at this point in the history
  • Loading branch information
coder9042 authored and shaib committed Jun 23, 2014
1 parent 908160f commit 1c50d6a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions django/db/backends/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,10 @@ class BaseDatabaseFeatures(object):
# at the end of each save operation?
supports_forward_references = True

# Does the backend uses proper method like 'truncate_name'
# to auto-truncate column names?
truncates_name = False

# Is there a REAL datatype in addition to floats/doubles?
has_real_datatype = False
supports_subqueries_in_group_by = True
Expand Down
1 change: 1 addition & 0 deletions django/db/backends/oracle/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ class DatabaseFeatures(BaseDatabaseFeatures):
supports_bitwise_or = False
can_defer_constraint_checks = True
supports_partially_nullable_unique_constraints = False
truncates_name = True
has_bulk_insert = True
supports_tablespaces = True
supports_sequence_reset = False
Expand Down
2 changes: 1 addition & 1 deletion django/db/models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1469,7 +1469,7 @@ def _check_long_column_names(cls):
continue
connection = connections[db]
max_name_length = connection.ops.max_name_length()
if max_name_length is None:
if max_name_length is None or connection.features.truncates_name:
continue
else:
if allowed_len is None:
Expand Down
2 changes: 1 addition & 1 deletion tests/invalid_models_tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def get_max_column_name_length():
for db in settings.DATABASES.keys():
connection = connections[db]
max_name_length = connection.ops.max_name_length()
if max_name_length is None:
if max_name_length is None or connection.features.truncates_name:
continue
else:
if allowed_len is None:
Expand Down

0 comments on commit 1c50d6a

Please sign in to comment.