compatibility with out-of-date sqlite: use '(1=0)' instead of 'false'

This commit is contained in:
Shish
2020-10-26 22:33:11 +00:00
parent e6e9d6db1c
commit 55e3cb5d63
11 changed files with 23 additions and 23 deletions

View File

@ -97,7 +97,7 @@ class Trash extends Extension
$matches = [];
if (is_null($event->term) && $this->no_trash_query($event->context)) {
$event->add_querylet(new Querylet("trash != :true", ["true"=>true]));
$event->add_querylet(new Querylet("trash = :false", ["false"=>false]));
}
if (is_null($event->term)) {
@ -182,7 +182,7 @@ class Trash extends Extension
global $database;
if ($this->get_version(TrashConfig::VERSION) < 1) {
$database->execute("ALTER TABLE images ADD COLUMN trash BOOLEAN NOT NULL DEFAULT FALSE");
$database->execute("ALTER TABLE images ADD COLUMN trash BOOLEAN NOT NULL DEFAULT (1=0)");
$database->execute("CREATE INDEX images_trash_idx ON images(trash)");
$this->set_version(TrashConfig::VERSION, 2);
}