boolinate locked
This commit is contained in:
parent
2c8432c643
commit
533ea85da9
2 changed files with 9 additions and 4 deletions
|
@ -255,7 +255,7 @@ function create_tables(Database $db)
|
||||||
width INTEGER NOT NULL,
|
width INTEGER NOT NULL,
|
||||||
height INTEGER NOT NULL,
|
height INTEGER NOT NULL,
|
||||||
posted TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
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
|
FOREIGN KEY (owner_id) REFERENCES users(id) ON DELETE RESTRICT
|
||||||
");
|
");
|
||||||
$db->execute("CREATE INDEX images_owner_id_idx ON images(owner_id)", []);
|
$db->execute("CREATE INDEX images_owner_id_idx ON images(owner_id)", []);
|
||||||
|
|
|
@ -32,9 +32,9 @@ class Upgrade extends Extension
|
||||||
// now done again as v9 with PDO
|
// now done again as v9 with PDO
|
||||||
|
|
||||||
if ($this->get_version("db_version") < 8) {
|
if ($this->get_version("db_version") < 8) {
|
||||||
$database->execute($database->scoreql_to_sql(
|
$database->execute(
|
||||||
"ALTER TABLE images ADD COLUMN locked SCORE_BOOL NOT NULL DEFAULT SCORE_BOOL_N"
|
"ALTER TABLE images ADD COLUMN locked BOOLEAN NOT NULL DEFAULT FALSE"
|
||||||
));
|
);
|
||||||
|
|
||||||
$this->set_version("db_version", 8);
|
$this->set_version("db_version", 8);
|
||||||
}
|
}
|
||||||
|
@ -197,6 +197,11 @@ class Upgrade extends Extension
|
||||||
|
|
||||||
$this->set_version("db_version", 19);
|
$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
|
public function get_priority(): int
|
||||||
|
|
Reference in a new issue