Kaydet (Commit) dd9b3312 authored tarafından Shai Berger's avatar Shai Berger

Fixed name of database connection feature

üst f7a78f9b
...@@ -520,9 +520,8 @@ class BaseDatabaseFeatures(object): ...@@ -520,9 +520,8 @@ class BaseDatabaseFeatures(object):
# at the end of each save operation? # at the end of each save operation?
supports_forward_references = True supports_forward_references = True
# Does the backend uses proper method like 'truncate_name' # Does the backend truncate names properly when they are too long?
# to auto-truncate column names? truncates_names = False
truncates_name = False
# Is there a REAL datatype in addition to floats/doubles? # Is there a REAL datatype in addition to floats/doubles?
has_real_datatype = False has_real_datatype = False
......
...@@ -107,7 +107,7 @@ class DatabaseFeatures(BaseDatabaseFeatures): ...@@ -107,7 +107,7 @@ class DatabaseFeatures(BaseDatabaseFeatures):
supports_bitwise_or = False supports_bitwise_or = False
can_defer_constraint_checks = True can_defer_constraint_checks = True
supports_partially_nullable_unique_constraints = False supports_partially_nullable_unique_constraints = False
truncates_name = True truncates_names = True
has_bulk_insert = True has_bulk_insert = True
supports_tablespaces = True supports_tablespaces = True
supports_sequence_reset = False supports_sequence_reset = False
......
...@@ -1479,7 +1479,7 @@ class Model(six.with_metaclass(ModelBase)): ...@@ -1479,7 +1479,7 @@ class Model(six.with_metaclass(ModelBase)):
continue continue
connection = connections[db] connection = connections[db]
max_name_length = connection.ops.max_name_length() max_name_length = connection.ops.max_name_length()
if max_name_length is None or connection.features.truncates_name: if max_name_length is None or connection.features.truncates_names:
continue continue
else: else:
if allowed_len is None: if allowed_len is None:
......
...@@ -18,7 +18,7 @@ def get_max_column_name_length(): ...@@ -18,7 +18,7 @@ def get_max_column_name_length():
for db in settings.DATABASES.keys(): for db in settings.DATABASES.keys():
connection = connections[db] connection = connections[db]
max_name_length = connection.ops.max_name_length() max_name_length = connection.ops.max_name_length()
if max_name_length is None or connection.features.truncates_name: if max_name_length is None or connection.features.truncates_names:
continue continue
else: else:
if allowed_len is None: if allowed_len is None:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment