Skip to content

Commit

Permalink
Add an index for left_ptr, since we use that in ORM_MPTT::parents()
Browse files Browse the repository at this point in the history
which is on every album page.  Bump Gallery module version to 33.
  • Loading branch information
bharat committed Aug 7, 2010
1 parent 67636ad commit 779d91c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions modules/gallery/helpers/gallery_installer.php
Expand Up @@ -114,7 +114,8 @@ static function install() {
KEY `parent_id` (`parent_id`),
KEY `type` (`type`),
KEY `random` (`rand_key`),
KEY `weight` (`weight` DESC))
KEY `weight` (`weight` DESC),
KEY `left_ptr` (`left_ptr`))
DEFAULT CHARSET=utf8;");

$db->query("CREATE TABLE {logs} (
Expand Down Expand Up @@ -298,7 +299,7 @@ static function install() {
module::set_var("gallery", "simultaneous_upload_limit", 5);
module::set_var("gallery", "admin_area_timeout", 90 * 60);
module::set_var("gallery", "maintenance_mode", 0);
module::set_version("gallery", 32);
module::set_version("gallery", 33);
}

static function upgrade($version) {
Expand Down Expand Up @@ -572,6 +573,11 @@ static function upgrade($version) {
->execute();
module::set_version("gallery", $version = 32);
}

if ($version == 32) {
$db->query("ALTER TABLE {items} ADD KEY (`left_ptr`)");
module::set_version("gallery", $version = 33);
}
}

static function uninstall() {
Expand Down
2 changes: 1 addition & 1 deletion modules/gallery/module.info
@@ -1,3 +1,3 @@
name = "Gallery 3"
description = "Gallery core application"
version = 32
version = 33

0 comments on commit 779d91c

Please sign in to comment.