diff options
| author | 2014-09-16 19:01:24 +0200 | |
|---|---|---|
| committer | 2014-09-16 19:01:24 +0200 | |
| commit | 17d1e67e822dd7b903328195b5957eaf38a6f47b (patch) | |
| tree | 5d8250483fc2ef174ea751a8b5645ed62b64e480 /lib/Minz/ModelPdo.php | |
| parent | a4e43e9c53ac404d16af5d913a56eeb444b1ce10 (diff) | |
Fix sqlite bug ON DELETE CASCADE
Foreign key constraints are not enabled by default.
See https://github.com/marienfressinaud/FreshRSS/issues/579
See http://stackoverflow.com/questions/13534040/sqlite3-foreign-keys-on-pdo
Diffstat (limited to 'lib/Minz/ModelPdo.php')
| -rw-r--r-- | lib/Minz/ModelPdo.php | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Minz/ModelPdo.php b/lib/Minz/ModelPdo.php index 45a1e9451..b4bfca746 100644 --- a/lib/Minz/ModelPdo.php +++ b/lib/Minz/ModelPdo.php @@ -77,6 +77,9 @@ class Minz_ModelPdo { $db['password'], $driver_options ); + if ($type === 'sqlite') { + $this->bd->exec('PRAGMA foreign_keys = ON;'); + } self::$sharedBd = $this->bd; } catch (Exception $e) { throw new Minz_PDOConnectionException( |
