1
0
mirror of https://github.com/django/django.git synced 2025-11-07 07:15:35 +00:00

Fixed #27097 -- Added index type introspection to built-in db backends.

This commit is contained in:
Akshesh
2016-08-25 12:42:17 +05:30
committed by Tim Graham
parent 082f5bfdbc
commit dbccf163b6
8 changed files with 23 additions and 20 deletions

View File

@@ -255,8 +255,10 @@ class DatabaseIntrospection(BaseDatabaseIntrospection):
"index": True,
}
constraints[index]['columns'].append(column)
# Add column orders for indexes
# 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'
cursor.execute(
"SELECT sql FROM sqlite_master "
"WHERE type='index' AND name=%s" % self.connection.ops.quote_name(index)