diff --git a/main.inc.php b/main.inc.php index b098bc175a890478dee7c40f99e7a42031ca37f9..fdd1a6863cc1e4b2210235415af5dbe49ee7634f 100644 --- a/main.inc.php +++ b/main.inc.php @@ -55,7 +55,7 @@ #Current version && schema signature (Changes from version to version) define('THIS_VERSION','1.7-DPR2'); //Shown on admin panel - define('SCHEMA_SIGNATURE','ssddsdsd'); //MD5 signature of the db schema. (used to trigger upgrades) + define('SCHEMA_SIGNATURE','abe9c0cb845be52c10fcd7b3e626a589'); //MD5 signature of the db schema. (used to trigger upgrades) #load config info $configfile=''; diff --git a/setup/inc/class.setup.php b/setup/inc/class.setup.php index 4662c2333738bdba6c221d4ace0caca2639bcc48..add91be89f15299203d5ac4b4424f2af92b72957 100644 --- a/setup/inc/class.setup.php +++ b/setup/inc/class.setup.php @@ -314,7 +314,7 @@ class Upgrader extends SetupWizard { if($this->getPendingTasks() || !($patch=$this->getNextPatch())) return false; - if(!$this->load_sql_file($patch, $this->getTablePrefix())) + if(!$this->load_sql_file($patch, $this->getTablePrefix(), true, true)) return false; //TODO: Log the upgrade diff --git a/setup/inc/sql/02decaa2-60fcbee1.patch.sql b/setup/inc/sql/02decaa2-60fcbee1.patch.sql index 351bea5821c9fc9a84743f780e5b8f3752b2a8e6..40dc644b3df64b0e103a3a7c16ed3c835a4bfae3 100644 --- a/setup/inc/sql/02decaa2-60fcbee1.patch.sql +++ b/setup/inc/sql/02decaa2-60fcbee1.patch.sql @@ -1,6 +1,6 @@ +-- Update all temlates with the new wording. UPDATE `%TABLE_PREFIX%email_template` - SET `overlimit_body` = '%name\r\n\r\nYou have reached the maximum number of open tickets allowed.\r\n\r\nTo be able to open another ticket, one of your pending tickets must be closed. To update or add comments to an open ticket simply login using the link below.\r\n\r\n%url/view.php?e=%email\r\n\r\nThank you.\r\n\r\nSupport Ticket System' - WHERE `tpl_id` = 1 AND `cfg_id` = 1; + SET `ticket_overlimit_body` = '%name\r\n\r\nYou have reached the maximum number of open tickets allowed.\r\n\r\nTo be able to open another ticket, one of your pending tickets must be closed. To update or add comments to an open ticket simply login using the link below.\r\n\r\n%url/view.php?e=%email\r\n\r\nThank you.\r\n\r\nSupport Ticket System'; UPDATE `%TABLE_PREFIX%config` SET `schema_signature`='60fcbee1da3180d1b690187aa5006c88'; diff --git a/setup/inc/sql/60fcbee1-f8856d56.patch.sql b/setup/inc/sql/60fcbee1-f8856d56.patch.sql index dcdb1850237b475327cd2b74c0e7fc00d68a5e62..2b7e48599816e88702f709f50557189b160a727e 100644 --- a/setup/inc/sql/60fcbee1-f8856d56.patch.sql +++ b/setup/inc/sql/60fcbee1-f8856d56.patch.sql @@ -1,10 +1,19 @@ -ALTER TABLE `%TABLE_PREFIX%history` - ADD `staff_id` int(11) unsigned NOT NULL AFTER `ticket_id`, - ADD `team_id` int(11) unsigned NOT NULL AFTER `staff_id`, - ADD `dept_id` int(11) unsigned NOT NULL AFTER `team_id`, - ADD `topic_id` int(11) unsigned NOT NULL AFTER `dept_id`; +DROP TABLE IF EXISTS `%TABLE_PREFIX%ticket_event`; +CREATE TABLE `%TABLE_PREFIX%ticket_event` ( + `ticket_id` int(11) unsigned NOT NULL default '0', + `staff_id` int(11) unsigned NOT NULL, + `team_id` int(11) unsigned NOT NULL, + `dept_id` int(11) unsigned NOT NULL, + `topic_id` int(11) unsigned NOT NULL, + `state` enum('created','closed','reopened','assigned','transferred','overdue') NOT NULL, + `staff` varchar(255) NOT NULL default 'SYSTEM', + `timestamp` datetime NOT NULL, + KEY `ticket_state` (`ticket_id`, `state`, `timestamp`), + KEY `ticket_stats` (`timestamp`, `state`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; -RENAME TABLE `%TABLE_PREFIX%history` TO `%TABLE_PREFIX%event`; +DROP TABLE IF EXISTS `%TABLE_PREFIX%ticket_history`; +DROP TABLE IF EXISTS `%TABLE_PREFIX%history`; UPDATE `%TABLE_PREFIX%config` SET `schema_signature`='f8856d56e51c5cc3416389de78b54515';