boolinate locked

This commit is contained in:
Shish 2020-10-26 23:30:52 +00:00
parent 2c8432c643
commit 533ea85da9
2 changed files with 9 additions and 4 deletions

View File

@ -255,7 +255,7 @@ function create_tables(Database $db)
width INTEGER NOT NULL,
height INTEGER NOT NULL,
posted TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
locked SCORE_BOOL NOT NULL DEFAULT SCORE_BOOL_N,
locked BOOLEAN NOT NULL DEFAULT FALSE,
FOREIGN KEY (owner_id) REFERENCES users(id) ON DELETE RESTRICT
");
$db->execute("CREATE INDEX images_owner_id_idx ON images(owner_id)", []);

View File

@ -32,9 +32,9 @@ class Upgrade extends Extension
// now done again as v9 with PDO
if ($this->get_version("db_version") < 8) {
$database->execute($database->scoreql_to_sql(
"ALTER TABLE images ADD COLUMN locked SCORE_BOOL NOT NULL DEFAULT SCORE_BOOL_N"
));
$database->execute(
"ALTER TABLE images ADD COLUMN locked BOOLEAN NOT NULL DEFAULT FALSE"
);
$this->set_version("db_version", 8);
}
@ -197,6 +197,11 @@ class Upgrade extends Extension
$this->set_version("db_version", 19);
}
if ($this->get_version("db_version") < 20) {
$database->standardise_boolean("images", "locked");
$this->set_version("db_version", 20);
}
}
public function get_priority(): int