forked from Cavemanon/cavepaintings
more version
This commit is contained in:
@@ -23,19 +23,17 @@ class Relationships extends Extension
|
||||
global $config, $database;
|
||||
|
||||
// Create the database tables
|
||||
if ($config->get_int("ext_relationships_version") < 1) {
|
||||
if ($this->get_version("ext_relationships_version") < 1) {
|
||||
$database->execute("ALTER TABLE images ADD parent_id INT");
|
||||
$database->execute($database->scoreql_to_sql("ALTER TABLE images ADD has_children SCORE_BOOL DEFAULT SCORE_BOOL_N NOT NULL"));
|
||||
$database->execute("CREATE INDEX images__parent_id ON images(parent_id)");
|
||||
|
||||
$config->set_int("ext_relationships_version", 1);
|
||||
log_info("relationships", "extension installed");
|
||||
$this->set_version("ext_relationships_version", 1);
|
||||
}
|
||||
if ($config->get_int("ext_relationships_version") < 2) {
|
||||
if ($this->get_version("ext_relationships_version") < 2) {
|
||||
$database->execute("CREATE INDEX images__has_children ON images(has_children)");
|
||||
|
||||
$config->set_int("ext_relationships_version", 2);
|
||||
log_info("relationships", "extension updated");
|
||||
$this->set_version("ext_relationships_version", 2);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user