Browse Source

Proactively support SQLite 3.25

microsub
J. King 5 years ago
parent
commit
161f5f08f6
  1. 8
      lib/Db/SQLite3/Driver.php

8
lib/Db/SQLite3/Driver.php

@ -121,17 +121,15 @@ class Driver extends \JKingWeb\Arsse\Db\AbstractDriver {
public function schemaUpdate(int $to, string $basePath = null): bool {
// turn off foreign keys
$this->exec("PRAGMA foreign_keys = no");
$this->exec("PRAGMA legacy_alter_table = yes");
// run the generic updater
try {
parent::schemaUpdate($to, $basePath);
} catch (\Throwable $e) {
} finally {
// turn foreign keys back on
$this->exec("PRAGMA foreign_keys = yes");
// pass the exception up
throw $e;
$this->exec("PRAGMA legacy_alter_table = no");
}
// turn foreign keys back on
$this->exec("PRAGMA foreign_keys = yes");
return true;
}

Loading…
Cancel
Save