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 ++++++++ 1 file changed, 8 insertions(+) (limited to 'modules/comment/helpers/comment_installer.php') 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}"; -- cgit v1.2.3