Merge pull request #60793 from nextcloud/backport/60733/stable34

[stable34] fix(DB): Enforce foreign key constraints in SQLite
This commit is contained in:
Andy Scherzinger 2026-05-28 15:51:30 +02:00 committed by GitHub
commit b67760a875
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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();