Skip to content

Commit

Permalink
[1.7.x] Fixed #24637 -- Fixed database introspection with SQLite 3.8.9.
Browse files Browse the repository at this point in the history
Backport of f8e8853 from master
  • Loading branch information
peterfarrell authored and timgraham committed Apr 14, 2015
1 parent 1b21666 commit d74903e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
5 changes: 4 additions & 1 deletion django/db/backends/sqlite3/introspection.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,10 @@ def get_constraints(self, cursor, table_name):
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():
Expand Down
8 changes: 8 additions & 0 deletions docs/releases/1.7.8.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
==========================
Django 1.7.7 release notes

This comment has been minimized.

Copy link
@raphaelm

raphaelm Apr 14, 2015

Contributor

Shouldn't this say 1.7.8?

This comment has been minimized.

Copy link
@MarkusH

MarkusH Apr 14, 2015

Member

Good catch. I'm on it.

This comment has been minimized.

Copy link
@MarkusH

MarkusH Apr 14, 2015

Member

Done. Thank you :)

==========================

*Under development*

Django 1.7.8 fixes database introspection with SQLite 3.8.9 (released April 8,
2015) (:ticket:`24637`).
1 change: 1 addition & 0 deletions docs/releases/index.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ versions of the documentation contain the release notes for any later releases.
.. toctree::
:maxdepth: 1

1.7.8
1.7.7
1.7.6
1.7.5
Expand Down

0 comments on commit d74903e

Please sign in to comment.