preliminary work for image locking
This commit is contained in:
parent
cfd1b72b86
commit
d8e3ba6f4d
@ -3,20 +3,24 @@
|
|||||||
class Upgrade implements Extension {
|
class Upgrade implements Extension {
|
||||||
public function receive_event(Event $event) {
|
public function receive_event(Event $event) {
|
||||||
if($event instanceof InitExtEvent) {
|
if($event instanceof InitExtEvent) {
|
||||||
$this->do_things();
|
$this->do_things($event->context);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private function do_things() {
|
private function do_things($context) {
|
||||||
global $config;
|
$config = $context->config;
|
||||||
global $database;
|
$database = $context->database;
|
||||||
|
|
||||||
if(!is_numeric($config->get_string("db_version"))) {
|
if(!is_numeric($config->get_string("db_version"))) {
|
||||||
$config->set_int("db_version", 2);
|
$config->set_int("db_version", 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($config->get_int("db_version") < 6) {
|
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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -187,6 +187,7 @@ function create_tables($dsn) { // {{{
|
|||||||
width INTEGER NOT NULL,
|
width INTEGER NOT NULL,
|
||||||
height INTEGER NOT NULL,
|
height INTEGER NOT NULL,
|
||||||
posted TIMESTAMP NOT NULL DEFAULT SCORE_NOW,
|
posted TIMESTAMP NOT NULL DEFAULT SCORE_NOW,
|
||||||
|
locked SCORE_BOOL NOT NULL DEFAULT SCORE_BOOL_N,
|
||||||
INDEX(owner_id),
|
INDEX(owner_id),
|
||||||
INDEX(width),
|
INDEX(width),
|
||||||
INDEX(height),
|
INDEX(height),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user