Merge pull request #60733 from nextcloud/fix/db/sqlite-foreign-key-constraints

fix(DB): Enforce foreign key constraints in SQLite
This commit is contained in:
Kate 2026-05-28 12:04:52 +02:00 committed by GitHub
commit b165048074
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();