summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-06-23 13:25:14 -0700
committerBharat Mediratta <bharat@menalto.com>2009-06-23 13:40:23 -0700
commite49c4a2459fd94d7df167b68432920ca95420767 (patch)
tree63b372c53d834994289772d1dcc12139d0ce7cf4
parent65a7967a046c22abadfd526954a2cd0002ea26cf (diff)
Upgrade to version 2 and change the state column to a varchar for
Postgres compatibility.
-rw-r--r--modules/comment/helpers/comment_installer.php8
-rw-r--r--modules/comment/module.info2
2 files changed, 9 insertions, 1 deletions
diff --git a/modules/comment/helpers/comment_installer.php b/modules/comment/helpers/comment_installer.php
index 2bfb7330..f5a7542b 100644
--- a/modules/comment/helpers/comment_installer.php
+++ b/modules/comment/helpers/comment_installer.php
@@ -51,6 +51,14 @@ class comment_installer {
module::set_version("comment", 1);
}
+ static function upgrade($version) {
+ if ($version == 1) {
+ $db = Database::instance();
+ $db->query("ALTER TABLE {comments} CHANGE `state` `state` varchar(15) default 'unpublished'");
+ module::set_version("comment", 2);
+ }
+ }
+
static function uninstall() {
$db = Database::instance();
$sql = "SELECT `item_id` FROM {comments}";
diff --git a/modules/comment/module.info b/modules/comment/module.info
index 08a800a6..946f1d39 100644
--- a/modules/comment/module.info
+++ b/modules/comment/module.info
@@ -1,3 +1,3 @@
name = Comments
description = Allows users and guests to leave comments on photos and albums.
-version = 1
+version = 2