Fixed #27135 -- Made index introspection return Index.suffix.
diff --git a/django/db/backends/mysql/introspection.py b/django/db/backends/mysql/introspection.py
index 20e017120c802..455e88962f0a5 100644
--- a/django/db/backends/mysql/introspection.py
+++ b/django/db/backends/mysql/introspection.py
@@ -6,6 +6,7 @@
 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 @@ def get_constraints(self, cursor, table_name):
                     '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():
diff --git a/django/db/backends/oracle/introspection.py b/django/db/backends/oracle/introspection.py
index 056edb6ce6f70..be6032180a3ab 100644
--- a/django/db/backends/oracle/introspection.py
+++ b/django/db/backends/oracle/introspection.py
@@ -274,7 +274,7 @@ def get_constraints(self, cursor, table_name):
                     "foreign_key": None,
                     "check": False,
                     "index": True,
-                    "type": 'btree' if type_ == 'normal' else type_,
+                    "type": 'idx' if type_ == 'normal' else type_,
                 }
             # Record the details
             constraints[constraint]['columns'].append(column)
diff --git a/django/db/backends/postgresql/introspection.py b/django/db/backends/postgresql/introspection.py
index d663de61e5d12..d50f6eb9c2f71 100644
--- a/django/db/backends/postgresql/introspection.py
+++ b/django/db/backends/postgresql/introspection.py
@@ -3,6 +3,7 @@
 from django.db.backends.base.introspection import (
     BaseDatabaseIntrospection, FieldInfo, TableInfo,
 )
+from django.db.models.indexes import Index
 from django.utils.deprecation import RemovedInDjango21Warning
 from django.utils.encoding import force_text
 
@@ -234,7 +235,7 @@ def get_constraints(self, cursor, table_name):
                     "foreign_key": None,
                     "check": False,
                     "index": True,
-                    "type": type_,
+                    "type": Index.suffix if type_ == 'btree' else type_,
                     "definition": definition,
                     "options": options,
                 }
diff --git a/django/db/backends/sqlite3/introspection.py b/django/db/backends/sqlite3/introspection.py
index 730793879d85b..eb15fdb612c14 100644
--- a/django/db/backends/sqlite3/introspection.py
+++ b/django/db/backends/sqlite3/introspection.py
@@ -4,6 +4,7 @@
 from django.db.backends.base.introspection import (
     BaseDatabaseIntrospection, FieldInfo, TableInfo,
 )
+from django.db.models.indexes import Index
 from django.utils.deprecation import RemovedInDjango21Warning
 
 field_size_re = re.compile(r'^\s*(?:var)?char\s*\(\s*(\d+)\s*\)\s*$')
@@ -262,7 +263,7 @@ def get_constraints(self, cursor, table_name):
             # Add type and column orders for indexes
             if constraints[index]['index'] and not constraints[index]['unique']:
                 # SQLite doesn't support any index type other than b-tree
-                constraints[index]['type'] = 'btree'
+                constraints[index]['type'] = Index.suffix
                 cursor.execute(
                     "SELECT sql FROM sqlite_master "
                     "WHERE type='index' AND name=%s" % self.connection.ops.quote_name(index)
diff --git a/tests/introspection/tests.py b/tests/introspection/tests.py
index 2993592e4f63c..4d96bf8514639 100644
--- a/tests/introspection/tests.py
+++ b/tests/introspection/tests.py
@@ -1,6 +1,7 @@
 from unittest import mock, skipUnless
 
 from django.db import connection
+from django.db.models import Index
 from django.db.utils import DatabaseError
 from django.test import TransactionTestCase, skipUnlessDBFeature
 from django.test.utils import ignore_warnings
@@ -191,7 +192,7 @@ def test_get_constraints_index_types(self):
         for key, val in constraints.items():
             if val['columns'] == ['headline', 'pub_date']:
                 index = val
-        self.assertEqual(index['type'], 'btree')
+        self.assertEqual(index['type'], Index.suffix)
 
     @skipUnlessDBFeature('supports_index_column_ordering')
     def test_get_constraints_indexes_orders(self):
diff --git a/tests/model_indexes/tests.py b/tests/model_indexes/tests.py
index 0e276dbd15b59..33e4bfaa7c0ad 100644
--- a/tests/model_indexes/tests.py
+++ b/tests/model_indexes/tests.py
@@ -1,10 +1,13 @@
 from django.db import models
-from django.test import TestCase
+from django.test import SimpleTestCase
 
 from .models import Book
 
 
-class IndexesTests(TestCase):
+class IndexesTests(SimpleTestCase):
+
+    def test_suffix(self):
+        self.assertEqual(models.Index.suffix, 'idx')
 
     def test_repr(self):
         index = models.Index(fields=['title'])
diff --git a/tests/postgres_tests/test_indexes.py b/tests/postgres_tests/test_indexes.py
index 9298b86e7387c..db61561200328 100644
--- a/tests/postgres_tests/test_indexes.py
+++ b/tests/postgres_tests/test_indexes.py
@@ -9,6 +9,9 @@
 @skipUnlessDBFeature('has_brin_index_support')
 class BrinIndexTests(PostgreSQLTestCase):
 
+    def test_suffix(self):
+        self.assertEqual(BrinIndex.suffix, 'brin')
+
     def test_repr(self):
         index = BrinIndex(fields=['title'], pages_per_range=4)
         another_index = BrinIndex(fields=['title'])
@@ -41,6 +44,9 @@ def test_invalid_pages_per_range(self):
 
 class GinIndexTests(PostgreSQLTestCase):
 
+    def test_suffix(self):
+        self.assertEqual(GinIndex.suffix, 'gin')
+
     def test_repr(self):
         index = GinIndex(fields=['title'])
         self.assertEqual(repr(index), "<GinIndex: fields='title'>")
@@ -84,7 +90,7 @@ def test_gin_index(self):
             editor.add_index(IntegerArrayModel, index)
         constraints = self.get_constraints(IntegerArrayModel._meta.db_table)
         # Check gin index was added
-        self.assertEqual(constraints[index_name]['type'], 'gin')
+        self.assertEqual(constraints[index_name]['type'], GinIndex.suffix)
         # Drop the index
         with connection.schema_editor() as editor:
             editor.remove_index(IntegerArrayModel, index)
@@ -97,7 +103,7 @@ def test_brin_index(self):
         with connection.schema_editor() as editor:
             editor.add_index(CharFieldModel, index)
         constraints = self.get_constraints(CharFieldModel._meta.db_table)
-        self.assertEqual(constraints[index_name]['type'], 'brin')
+        self.assertEqual(constraints[index_name]['type'], BrinIndex.suffix)
         self.assertEqual(constraints[index_name]['options'], ['pages_per_range=4'])
         with connection.schema_editor() as editor:
             editor.remove_index(CharFieldModel, index)

https://code.djangoproject.com/ticket/27135