From e49c4a2459fd94d7df167b68432920ca95420767 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Tue, 23 Jun 2009 13:25:14 -0700 Subject: Upgrade to version 2 and change the state column to a varchar for Postgres compatibility. --- modules/comment/helpers/comment_installer.php | 8 ++++++++ modules/comment/module.info | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'modules/comment') 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 -- cgit v1.2.3