From 9d6f32d2d792fb2334f8ef281276410bb8384913 Mon Sep 17 00:00:00 2001 From: provokateurin Date: Mon, 4 May 2026 10:05:55 +0200 Subject: [PATCH] fix(DB): Enforce foreign key constraints in SQLite Signed-off-by: provokateurin --- lib/private/DB/SQLiteSessionInit.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/private/DB/SQLiteSessionInit.php b/lib/private/DB/SQLiteSessionInit.php index 3e05b6e59a15c..79ed20e1da1db 100644 --- a/lib/private/DB/SQLiteSessionInit.php +++ b/lib/private/DB/SQLiteSessionInit.php @@ -41,6 +41,7 @@ public function postConnect(ConnectionEventArgs $args) { $sensitive = $this->caseSensitiveLike ? 'true' : 'false'; $args->getConnection()->executeUpdate('PRAGMA case_sensitive_like = ' . $sensitive); $args->getConnection()->executeUpdate('PRAGMA journal_mode = ' . $this->journalMode); + $args->getConnection()->executeUpdate('PRAGMA foreign_keys = true'); /** @var \Doctrine\DBAL\Driver\PDO\Connection $connection */ $connection = $args->getConnection()->getWrappedConnection(); $pdo = $connection->getWrappedConnection();