diff options
author | Romain LE DISEZ <romain.git@ledisez.net> | 2009-06-24 23:02:57 +0200 |
---|---|---|
committer | Romain LE DISEZ <romain.git@ledisez.net> | 2009-06-24 23:02:57 +0200 |
commit | 6111272568a732465c330597a068a048f6705ef9 (patch) | |
tree | f8829dfb4c4ee566a69f91d397e74e74aec56dbd /modules/notification/helpers | |
parent | de28b0350e5d5bf6c3e1eb5a9531298b08fd7cba (diff) | |
parent | f56d372629df5b08a30d0182d4e1e7c97a44d79f (diff) |
Merge commit 'upstream/master'
Conflicts:
modules/comment/helpers/comment_installer.php
modules/gallery/models/item.php
Diffstat (limited to 'modules/notification/helpers')
-rw-r--r-- | modules/notification/helpers/notification_installer.php | 36 |
1 files changed, 16 insertions, 20 deletions
diff --git a/modules/notification/helpers/notification_installer.php b/modules/notification/helpers/notification_installer.php index ad10184b..3d450258 100644 --- a/modules/notification/helpers/notification_installer.php +++ b/modules/notification/helpers/notification_installer.php @@ -20,27 +20,23 @@ class notification_installer { static function install() { $db = Database::instance(); - $version = module::get_version("notification"); + $db->query("CREATE TABLE IF NOT EXISTS {subscriptions} ( + `id` int(9) NOT NULL auto_increment, + `item_id` int(9) NOT NULL, + `user_id` int(9) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY (`item_id`, `user_id`), + UNIQUE KEY (`user_id`, `item_id`)) + ENGINE=InnoDB DEFAULT CHARSET=utf8;"); + $db->query("CREATE TABLE IF NOT EXISTS {pending_notifications} ( + `id` int(9) NOT NULL auto_increment, + `email` varchar(128) NOT NULL, + `subject` varchar(255) NOT NULL, + `text` text, + PRIMARY KEY (`id`)) + ENGINE=InnoDB DEFAULT CHARSET=utf8;"); - if ($version == 0) { - $db->query("CREATE TABLE IF NOT EXISTS {subscriptions} ( - `id` int(9) NOT NULL auto_increment, - `item_id` int(9) NOT NULL, - `user_id` int(9) NOT NULL, - PRIMARY KEY (`id`), - UNIQUE KEY (`item_id`, `user_id`), - UNIQUE KEY (`user_id`, `item_id`)) - ENGINE=InnoDB DEFAULT CHARSET=utf8;"); - $db->query("CREATE TABLE IF NOT EXISTS {pending_notifications} ( - `id` int(9) NOT NULL auto_increment, - `email` varchar(128) NOT NULL, - `subject` varchar(255) NOT NULL, - `text` text, - PRIMARY KEY (`id`)) - ENGINE=InnoDB DEFAULT CHARSET=utf8;"); - - module::set_version("notification", 1); - } + module::set_version("notification", 1); } static function uninstall() { |