From 37fc9fa1471113f0211a35b83015e54238c05ba8 Mon Sep 17 00:00:00 2001 From: Sebastian Grewe Date: Mon, 10 Jun 2013 08:51:24 +0200 Subject: [PATCH] adding full notification SQL for regular installations --- sql/issue_144_notification_upgrade.sql | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/sql/issue_144_notification_upgrade.sql b/sql/issue_144_notification_upgrade.sql index fd7ae177..73985979 100644 --- a/sql/issue_144_notification_upgrade.sql +++ b/sql/issue_144_notification_upgrade.sql @@ -1,7 +1,17 @@ -ALTER TABLE `notifications` ADD `account_id` INT UNSIGNED NULL DEFAULT NULL , ADD INDEX ( `account_id` ); -ALTER TABLE `notifications` CHANGE `time` `time` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP; +CREATE TABLE IF NOT EXISTS `notifications` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `type` varchar(25) NOT NULL, + `data` varchar(255) NOT NULL, + `active` tinyint(1) NOT NULL DEFAULT '1', + `time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `account_id` int(10) unsigned DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `active` (`active`), + KEY `data` (`data`), + KEY `account_id` (`account_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `notification_settings` ( - `type` varchar(15) NOT NULL, - `account_id` int(11) NOT NULL, - `active` tinyint(1) NOT NULL DEFAULT '0' + `type` varchar(15) NOT NULL, + `account_id` int(11) NOT NULL, + `active` tinyint(1) NOT NULL DEFAULT '0' ) ENGINE=InnoDB DEFAULT CHARSET=utf8;