Permalink
Browse files

Added changes to installer and upgrader scripts to support INSERT ON …

…DUPLICATE KEY UPDATE SYNTAX in cache lib
  • Loading branch information...
1 parent 66fd8c7 commit 440597356d8719bdc6733d2d86aaef5f86d05a1e @Joe7 Joe7 committed with bharat Dec 27, 2010
Showing with 8 additions and 3 deletions.
  1. +1 −1 installer/install.sql
  2. +6 −1 modules/gallery/helpers/gallery_installer.php
  3. +1 −1 modules/gallery/module.info
View
@@ -43,7 +43,7 @@ CREATE TABLE {caches} (
`expiration` int(9) NOT NULL,
`cache` longblob,
PRIMARY KEY (`id`),
- KEY `key` (`key`),
+ UNIQUE KEY `key` (`key`),
KEY `tags` (`tags`)
) DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
@@ -309,7 +309,7 @@ static function install() {
module::set_var("gallery", "show_user_profiles_to", "registered_users");
module::set_var("gallery", "extra_binary_paths", "/usr/local/bin:/opt/local/bin:/opt/bin");
- module::set_version("gallery", 41);
+ module::set_version("gallery", 42);
}
static function upgrade($version) {
@@ -642,6 +642,11 @@ static function upgrade($version) {
module::clear_var("gallery", "_cache");
module::set_version("gallery", $version = 41);
}
+
+ if ($version == 41) {
+ $db->query("ALTER TABLE {caches} DROP INDEX `key`, ADD UNIQUE `key` (`key`)");
+ module::set_version("gallery", $version = 42);
+ }
}
static function uninstall() {
@@ -1,3 +1,3 @@
name = "Gallery 3"
description = "Gallery core application"
-version = 41
+version = 42

0 comments on commit 4405973

Please sign in to comment.