summaryrefslogtreecommitdiff
path: root/django/db/backends/mysql/introspection.py
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2017-02-15 13:33:55 -0500
committerTim Graham <timograham@gmail.com>2017-02-15 20:15:02 -0500
commitb008f7cc5655d01817a8825e6317877b43c92181 (patch)
tree4e70b2dbab77c2dee5e6fdc43c87535c52126740 /django/db/backends/mysql/introspection.py
parenta7214f0e84913a27e0b73de89d4c827ef1c53b94 (diff)
downloaddjango-b008f7cc5655d01817a8825e6317877b43c92181.tar.gz
Fixed #27135 -- Made index introspection return Index.suffix.
Diffstat (limited to 'django/db/backends/mysql/introspection.py')
-rw-r--r--django/db/backends/mysql/introspection.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/django/db/backends/mysql/introspection.py b/django/db/backends/mysql/introspection.py
index 20e017120c..455e88962f 100644
--- a/django/db/backends/mysql/introspection.py
+++ b/django/db/backends/mysql/introspection.py
@@ -6,6 +6,7 @@ from MySQLdb.constants import FIELD_TYPE
from django.db.backends.base.introspection import (
BaseDatabaseIntrospection, FieldInfo, TableInfo,
)
+from django.db.models.indexes import Index
from django.utils.datastructures import OrderedSet
from django.utils.deprecation import RemovedInDjango21Warning
from django.utils.encoding import force_text
@@ -217,7 +218,7 @@ class DatabaseIntrospection(BaseDatabaseIntrospection):
'foreign_key': None,
}
constraints[index]['index'] = True
- constraints[index]['type'] = type_.lower()
+ constraints[index]['type'] = Index.suffix if type_ == 'BTREE' else type_.lower()
constraints[index]['columns'].add(column)
# Convert the sorted sets to lists
for constraint in constraints.values():