From d8e3ba6f4d6ccb9053616d706aa94797f7d64e1f Mon Sep 17 00:00:00 2001 From: Shish Date: Sat, 24 Jan 2009 03:59:51 -0800 Subject: [PATCH] preliminary work for image locking --- ext/upgrade/main.php | 14 +++++++++----- install.php | 1 + 2 files changed, 10 insertions(+), 5 deletions(-) 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),