mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #24637 -- Fixed database introspection with SQLite 3.8.9.
This commit is contained in:
@@ -239,7 +239,10 @@ class DatabaseIntrospection(BaseDatabaseIntrospection):
|
||||
constraints = {}
|
||||
# Get the index info
|
||||
cursor.execute("PRAGMA index_list(%s)" % self.connection.ops.quote_name(table_name))
|
||||
for number, index, unique in cursor.fetchall():
|
||||
for row in cursor.fetchall():
|
||||
# Sqlite3 3.8.9+ has 5 columns, however older versions only give 3
|
||||
# columns. Discard last 2 columns if there.
|
||||
number, index, unique = row[:3]
|
||||
# Get the index info for that index
|
||||
cursor.execute('PRAGMA index_info(%s)' % self.connection.ops.quote_name(index))
|
||||
for index_rank, column_rank, column in cursor.fetchall():
|
||||
|
||||
Reference in New Issue
Block a user