From 5114b6848d29e9388d51b1c0d3e1fbfb32db89c8 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 ed3392e9678..e3c64924e63 100644 --- a/lib/private/DB/SQLiteSessionInit.php +++ b/lib/private/DB/SQLiteSessionInit.php @@ -25,6 +25,7 @@ class SQLiteSessionInit implements EventSubscriber { $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();