Fixed #31765 -- Disabled bundled SQLite renaming atomic references on macOS 10.15.

This commit is contained in:
Tom Forbes 2020-07-21 11:42:39 +02:00 committed by Mariusz Felisiak
parent ff55adbd0d
commit 80a8be03d9
1 changed files with 9 additions and 1 deletions

View File

@ -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{