summaryrefslogtreecommitdiff
path: root/modules/gallery/helpers
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-06-28 16:48:29 -0700
committerBharat Mediratta <bharat@menalto.com>2009-06-28 16:48:29 -0700
commitfcc57a418245b6cac410f70506f6f4b687c8a98a (patch)
tree94ea320de4d5c040c302ec1ed162af6c6b6a9fd8 /modules/gallery/helpers
parentaa31e1f0090522c3cfb3a44b947ad8c33a275979 (diff)
Modify the cache table to make id the primary key for consistency with
other gallery 3 tables. Update the driver to match, add more upgrader code, update the installer block and change the gallery module version to 6.
Diffstat (limited to 'modules/gallery/helpers')
-rw-r--r--modules/gallery/helpers/gallery_installer.php14
1 files changed, 12 insertions, 2 deletions
diff --git a/modules/gallery/helpers/gallery_installer.php b/modules/gallery/helpers/gallery_installer.php
index d0bfa629..c3c3543c 100644
--- a/modules/gallery/helpers/gallery_installer.php
+++ b/modules/gallery/helpers/gallery_installer.php
@@ -33,7 +33,8 @@ class gallery_installer {
ENGINE=InnoDB DEFAULT CHARSET=utf8;");
$db->query("CREATE TABLE {caches} (
- `id` varchar(255) NOT NULL,
+ `id` int(9) NOT NULL auto_increment,
+ `key` varchar(255) NOT NULL,
`tags` varchar(255),
`expiration` int(9) NOT NULL,
`cache` longblob,
@@ -287,11 +288,20 @@ class gallery_installer {
ENGINE=InnoDB DEFAULT CHARSET=utf8;");
module::set_version("gallery", $version = 4);
}
+
if ($version == 4) {
Cache::instance()->delete_all();
- $db->query("ALTER TABLE {caches} modify column cache LONGBLOB");
+ $db->query("ALTER TABLE {caches} MODIFY COLUMN `cache` LONGBLOB");
module::set_version("gallery", $version = 5);
}
+
+ if ($version == 5) {
+ Cache::instance()->delete_all();
+ $db->query("ALTER TABLE {caches} DROP COLUMN `id`");
+ $db->query("ALTER TABLE {caches} ADD COLUMN `key` varchar(255) NOT NULL");
+ $db->query("ALTER TABLE {caches} ADD COLUMN `id` int(9) NOT NULL auto_increment PRIMARY KEY");
+ module::set_version("gallery", $version = 6);
+ }
}
static function uninstall() {