From 4483a9b12f295908e68b82d6599f460de943444f Mon Sep 17 00:00:00 2001 From: Mariusz Felisiak Date: Mon, 29 Aug 2022 09:55:45 +0200 Subject: [PATCH] Fixed #33960 -- Fixed migrations crash on SQLite < 3.26. Regression in 0b95a96ee10d3e12aef01d449467bcf4641286b4. Thanks Aristotelis Mikropoulos for the report. --- django/db/backends/sqlite3/base.py | 2 +- docs/releases/4.1.1.txt | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/django/db/backends/sqlite3/base.py b/django/db/backends/sqlite3/base.py index f495ff39a1..feae360567 100644 --- a/django/db/backends/sqlite3/base.py +++ b/django/db/backends/sqlite3/base.py @@ -301,7 +301,7 @@ class DatabaseWrapper(BaseDatabaseWrapper): for column_name, ( referenced_column_name, referenced_table_name, - ) in relations: + ) in relations.items(): cursor.execute( """ SELECT REFERRING.`%s`, REFERRING.`%s` FROM `%s` as REFERRING diff --git a/docs/releases/4.1.1.txt b/docs/releases/4.1.1.txt index f97015b9fa..2e4782f904 100644 --- a/docs/releases/4.1.1.txt +++ b/docs/releases/4.1.1.txt @@ -52,3 +52,6 @@ Bugfixes * Reallowed, following a regression in Django 4.1, creating reverse foreign key managers on unsaved instances (:ticket:`33952`). + +* Fixed a regression in Django 4.1 that caused a migration crash on SQLite < + 3.20 (:ticket:`33960`).