summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Charette <charette.s@gmail.com>2018-12-13 23:36:02 -0500
committerCarlton Gibson <carlton.gibson@noumenal.es>2018-12-17 11:03:44 +0100
commit1939dd49d142b65fa22eb5f85cee0d20864d3730 (patch)
tree23abf79091c83ea4b131a48bb737b04cab05d012
parent894cb13779e6d092974c873bd2cf1452554d2e06 (diff)
Fixed #29928 -- Enabled deferred constraint checks on SQLite 3.20+.
Refs #11665, #14204. Thanks Michel Samia for the report.
-rw-r--r--django/db/backends/sqlite3/features.py3
-rw-r--r--docs/releases/2.2.txt5
2 files changed, 8 insertions, 0 deletions
diff --git a/django/db/backends/sqlite3/features.py b/django/db/backends/sqlite3/features.py
index c61b0609d5..685c60a443 100644
--- a/django/db/backends/sqlite3/features.py
+++ b/django/db/backends/sqlite3/features.py
@@ -38,6 +38,9 @@ class DatabaseFeatures(BaseDatabaseFeatures):
# Is "ALTER TABLE ... RENAME COLUMN" supported?
can_alter_table_rename_column = Database.sqlite_version_info >= (3, 25, 0)
supports_parentheses_in_compound = False
+ # Deferred constraint checks can be emulated on SQLite < 3.20 but not in a
+ # reasonably performant way.
+ can_defer_constraint_checks = Database.version_info >= (3, 20, 0)
@cached_property
def supports_stddev(self):
diff --git a/docs/releases/2.2.txt b/docs/releases/2.2.txt
index d99cebd875..e6162a7fe4 100644
--- a/docs/releases/2.2.txt
+++ b/docs/releases/2.2.txt
@@ -265,6 +265,11 @@ Tests
* The new :setting:`ORACLE_MANAGED_FILES <TEST_ORACLE_MANAGED_FILES>` test
database setting allows using Oracle Managed Files (OMF) tablespaces.
+* Deferrable database constraints are now checked at the end of each
+ :class:`~django.test.TestCase` test on SQLite 3.20+ as well. These checks
+ were previously skipped on SQLite because they required expensive table
+ introspection before version 3.20 introduced native support.
+
URLs
~~~~