From 80a8be03d9321669a239dbced8ac48a4ebbbb7e1 Mon Sep 17 00:00:00 2001 From: Tom Forbes Date: Tue, 21 Jul 2020 11:42:39 +0200 Subject: [PATCH] Fixed #31765 -- Disabled bundled SQLite renaming atomic references on macOS 10.15. --- django/db/backends/sqlite3/features.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/django/db/backends/sqlite3/features.py b/django/db/backends/sqlite3/features.py index 84358838db..9e5ce4c4ae 100644 --- a/django/db/backends/sqlite3/features.py +++ b/django/db/backends/sqlite3/features.py @@ -1,4 +1,5 @@ import operator +import platform from django.db import transaction from django.db.backends.base.features import BaseDatabaseFeatures @@ -21,7 +22,6 @@ class DatabaseFeatures(BaseDatabaseFeatures): supports_transactions = True atomic_transactions = False can_rollback_ddl = True - supports_atomic_references_rename = Database.sqlite_version_info >= (3, 26, 0) can_create_inline_fk = False supports_paramstyle_pyformat = False can_clone_databases = True @@ -44,6 +44,14 @@ class DatabaseFeatures(BaseDatabaseFeatures): supports_order_by_nulls_modifier = Database.sqlite_version_info >= (3, 30, 0) order_by_nulls_first = True + @cached_property + def supports_atomic_references_rename(self): + # SQLite 3.28.0 bundled with MacOS 10.15 does not support renaming + # references atomically. + if platform.mac_ver()[0].startswith('10.15.') and Database.sqlite_version_info == (3, 28, 0): + return False + return Database.sqlite_version_info >= (3, 26, 0) + @cached_property def introspected_field_types(self): return{