mirror of
https://github.com/django/django.git
synced 2025-08-07 10:29:19 +00:00
Refs #29928 -- Added supports_pragma_foreign_key_check SQLite feature flag.
This commit is contained in:
parent
f3eb1cfb58
commit
6b9bd0933e
@ -267,7 +267,7 @@ class DatabaseWrapper(BaseDatabaseWrapper):
|
|||||||
determine if rows with invalid references were entered while constraint
|
determine if rows with invalid references were entered while constraint
|
||||||
checks were off.
|
checks were off.
|
||||||
"""
|
"""
|
||||||
if Database.sqlite_version_info >= (3, 20, 0):
|
if self.features.supports_pragma_foreign_key_check:
|
||||||
with self.cursor() as cursor:
|
with self.cursor() as cursor:
|
||||||
if table_names is None:
|
if table_names is None:
|
||||||
violations = self.cursor().execute('PRAGMA foreign_key_check').fetchall()
|
violations = self.cursor().execute('PRAGMA foreign_key_check').fetchall()
|
||||||
|
@ -40,7 +40,8 @@ class DatabaseFeatures(BaseDatabaseFeatures):
|
|||||||
supports_parentheses_in_compound = False
|
supports_parentheses_in_compound = False
|
||||||
# Deferred constraint checks can be emulated on SQLite < 3.20 but not in a
|
# Deferred constraint checks can be emulated on SQLite < 3.20 but not in a
|
||||||
# reasonably performant way.
|
# reasonably performant way.
|
||||||
can_defer_constraint_checks = Database.sqlite_version_info >= (3, 20, 0)
|
supports_pragma_foreign_key_check = Database.sqlite_version_info >= (3, 20, 0)
|
||||||
|
can_defer_constraint_checks = supports_pragma_foreign_key_check
|
||||||
|
|
||||||
@cached_property
|
@cached_property
|
||||||
def supports_stddev(self):
|
def supports_stddev(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user