diff options
author | peterfarrell <pfarrell@greatbiztools.com> | 2015-04-13 16:54:04 -0400 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2015-04-14 11:29:59 -0400 |
commit | f8e8853b51476af1cc75a229dadc990c9ccf45ec (patch) | |
tree | 067e8d6e9e68843d4caf3b8e774d35672256e014 /django/db/backends/sqlite3/introspection.py | |
parent | b333d10618f8ddbf665499a2db8eca8bd78d0939 (diff) | |
download | django-f8e8853b51476af1cc75a229dadc990c9ccf45ec.tar.gz |
Fixed #24637 -- Fixed database introspection with SQLite 3.8.9.
Diffstat (limited to 'django/db/backends/sqlite3/introspection.py')
-rw-r--r-- | django/db/backends/sqlite3/introspection.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/django/db/backends/sqlite3/introspection.py b/django/db/backends/sqlite3/introspection.py index 5f3fb4a45d..1b84d12ac5 100644 --- a/django/db/backends/sqlite3/introspection.py +++ b/django/db/backends/sqlite3/introspection.py @@ -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(): |