summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
Diffstat (limited to 'django')
-rw-r--r--django/db/models/indexes.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/django/db/models/indexes.py b/django/db/models/indexes.py
index 0ee2bf3610..7cda26508e 100644
--- a/django/db/models/indexes.py
+++ b/django/db/models/indexes.py
@@ -2,6 +2,7 @@ from __future__ import unicode_literals
import hashlib
+from django.db.backends.utils import split_identifier
from django.utils.encoding import force_bytes
__all__ = [str('Index')]
@@ -101,7 +102,7 @@ class Index(object):
(8 chars) and unique hash + suffix (10 chars). Each part is made to
fit its size by truncating the excess length.
"""
- table_name = model._meta.db_table
+ _, table_name = split_identifier(model._meta.db_table)
column_names = [model._meta.get_field(field_name).column for field_name, order in self.fields_orders]
column_names_with_order = [
(('-%s' if order else '%s') % column_name)