Skip to content

Commit 1939dd4

Browse files
charettescarltongibson
authored andcommittedDec 17, 2018
Fixed #29928 -- Enabled deferred constraint checks on SQLite 3.20+.
Refs django#11665, django#14204. Thanks Michel Samia for the report.
1 parent 894cb13 commit 1939dd4

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed
 

‎django/db/backends/sqlite3/features.py

+3
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ class DatabaseFeatures(BaseDatabaseFeatures):
3838
# Is "ALTER TABLE ... RENAME COLUMN" supported?
3939
can_alter_table_rename_column = Database.sqlite_version_info >= (3, 25, 0)
4040
supports_parentheses_in_compound = False
41+
# Deferred constraint checks can be emulated on SQLite < 3.20 but not in a
42+
# reasonably performant way.
43+
can_defer_constraint_checks = Database.version_info >= (3, 20, 0)
4144

4245
@cached_property
4346
def supports_stddev(self):

‎docs/releases/2.2.txt

+5
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,11 @@ Tests
265265
* The new :setting:`ORACLE_MANAGED_FILES <TEST_ORACLE_MANAGED_FILES>` test
266266
database setting allows using Oracle Managed Files (OMF) tablespaces.
267267

268+
* Deferrable database constraints are now checked at the end of each
269+
:class:`~django.test.TestCase` test on SQLite 3.20+ as well. These checks
270+
were previously skipped on SQLite because they required expensive table
271+
introspection before version 3.20 introduced native support.
272+
268273
URLs
269274
~~~~
270275

0 commit comments

Comments
 (0)
Please sign in to comment.