summaryrefslogtreecommitdiff
path: root/django/db/backends/postgresql/introspection.py
diff options
context:
space:
mode:
authorNick Pope <nick.pope@flightdataservices.com>2018-07-30 23:28:11 +0100
committerTim Graham <timograham@gmail.com>2018-08-02 11:42:57 -0400
commit6b4d1ec8ff97cff4f1683912b0147d22410b05b8 (patch)
tree07604a2c67f6378cc96084445ecd90fe8a0a23ea /django/db/backends/postgresql/introspection.py
parentd6381d3559b469ce25f4906151b9329c1f946f14 (diff)
downloaddjango-6b4d1ec8ff97cff4f1683912b0147d22410b05b8.tar.gz
Fixed #29614 -- Added BTreeIndex to django.contrib.postres.
Diffstat (limited to 'django/db/backends/postgresql/introspection.py')
-rw-r--r--django/db/backends/postgresql/introspection.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/django/db/backends/postgresql/introspection.py b/django/db/backends/postgresql/introspection.py
index a24e37b0b8..584a2e86b6 100644
--- a/django/db/backends/postgresql/introspection.py
+++ b/django/db/backends/postgresql/introspection.py
@@ -200,6 +200,7 @@ class DatabaseIntrospection(BaseDatabaseIntrospection):
""", [table_name])
for index, columns, unique, primary, orders, type_, definition, options in cursor.fetchall():
if index not in constraints:
+ basic_index = type_ == 'btree' and not index.endswith('_btree') and options is None
constraints[index] = {
"columns": columns if columns != [None] else [],
"orders": orders if orders != [None] else [],
@@ -208,7 +209,7 @@ class DatabaseIntrospection(BaseDatabaseIntrospection):
"foreign_key": None,
"check": False,
"index": True,
- "type": Index.suffix if type_ == 'btree' else type_,
+ "type": Index.suffix if basic_index else type_,
"definition": definition,
"options": options,
}