mirror of
https://code.mensbeam.com/MensBeam/Arsse.git
synced 2024-12-31 21:12:41 +00:00
Proactively support SQLite 3.25
This commit is contained in:
parent
28f803dd28
commit
161f5f08f6
1 changed files with 3 additions and 5 deletions
|
@ -121,17 +121,15 @@ class Driver extends \JKingWeb\Arsse\Db\AbstractDriver {
|
||||||
public function schemaUpdate(int $to, string $basePath = null): bool {
|
public function schemaUpdate(int $to, string $basePath = null): bool {
|
||||||
// turn off foreign keys
|
// turn off foreign keys
|
||||||
$this->exec("PRAGMA foreign_keys = no");
|
$this->exec("PRAGMA foreign_keys = no");
|
||||||
|
$this->exec("PRAGMA legacy_alter_table = yes");
|
||||||
// run the generic updater
|
// run the generic updater
|
||||||
try {
|
try {
|
||||||
parent::schemaUpdate($to, $basePath);
|
parent::schemaUpdate($to, $basePath);
|
||||||
} catch (\Throwable $e) {
|
} finally {
|
||||||
// turn foreign keys back on
|
// turn foreign keys back on
|
||||||
$this->exec("PRAGMA foreign_keys = yes");
|
$this->exec("PRAGMA foreign_keys = yes");
|
||||||
// pass the exception up
|
$this->exec("PRAGMA legacy_alter_table = no");
|
||||||
throw $e;
|
|
||||||
}
|
}
|
||||||
// turn foreign keys back on
|
|
||||||
$this->exec("PRAGMA foreign_keys = yes");
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue