diff --git a/ext/upgrade/main.php b/ext/upgrade/main.php index 6eb5147b..ef963489 100644 --- a/ext/upgrade/main.php +++ b/ext/upgrade/main.php @@ -3,20 +3,24 @@ class Upgrade implements Extension { public function receive_event(Event $event) { if($event instanceof InitExtEvent) { - $this->do_things(); + $this->do_things($event->context); } } - private function do_things() { - global $config; - global $database; + private function do_things($context) { + $config = $context->config; + $database = $context->database; if(!is_numeric($config->get_string("db_version"))) { $config->set_int("db_version", 2); } if($config->get_int("db_version") < 6) { - $database->upgrade_schema("ext/upgrade/schema.xml"); + // cry :S + } + + if($config->get_int("db_version") < 6) { // 7 + // add column image->locked } } } diff --git a/install.php b/install.php index 3c5cd064..445afa44 100644 --- a/install.php +++ b/install.php @@ -187,6 +187,7 @@ function create_tables($dsn) { // {{{ width INTEGER NOT NULL, height INTEGER NOT NULL, posted TIMESTAMP NOT NULL DEFAULT SCORE_NOW, + locked SCORE_BOOL NOT NULL DEFAULT SCORE_BOOL_N, INDEX(owner_id), INDEX(width), INDEX(height),