Fixes ticket status that did not conform to the current ticket statuses to Open

This commit is contained in:
johnnyq 2024-03-30 15:06:52 -04:00
parent 349a276de2
commit 387d2733fa
3 changed files with 29 additions and 18 deletions

View File

@ -1775,10 +1775,18 @@ if (LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION) {
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '1.1.6'");
}
// if (CURRENT_DATABASE_VERSION == '1.1.6') {
// // Insert queries here required to update to DB version 1.1.7
if (CURRENT_DATABASE_VERSION == '1.1.6') {
// Update existing tickets that did not use the defined statuses to Open
mysqli_query($mysqli, "UPDATE tickets SET ticket_status = 2 WHERE ticket_status NOT IN ('New', 'Open', 'On Hold', 'Auto Close') AND ticket_closed_at IS NULL");
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '1.1.7'");
}
// if (CURRENT_DATABASE_VERSION == '1.1.7') {
// // Insert queries here required to update to DB version 1.1.8
// // Then, update the database to the next sequential version
// mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '1.1.7'");
// mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '1.1.8");
// }
} else {

View File

@ -5,4 +5,4 @@
* It is used in conjunction with database_updates.php
*/
DEFINE("LATEST_DATABASE_VERSION", "1.1.6");
DEFINE("LATEST_DATABASE_VERSION", "1.1.7");

31
db.sql
View File

@ -1597,6 +1597,22 @@ CREATE TABLE `ticket_replies` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `ticket_statuses`
--
DROP TABLE IF EXISTS `ticket_statuses`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ticket_statuses` (
`ticket_status_id` int(11) NOT NULL AUTO_INCREMENT,
`ticket_status_name` varchar(200) NOT NULL,
`ticket_status_color` varchar(200) NOT NULL,
`ticket_status_active` tinyint(1) NOT NULL DEFAULT 1,
PRIMARY KEY (`ticket_status_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `ticket_templates`
--
@ -1618,19 +1634,6 @@ CREATE TABLE `ticket_templates` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `ticket_statuses`
--
DROP TABLE IF EXISTS `ticket_statuses`;
CREATE TABLE IF NOT EXISTS `ticket_statuses` (
`ticket_status_id` int(11) NOT NULL AUTO_INCREMENT,
`ticket_status_name` varchar(200) NOT NULL,
`ticket_status_color` varchar(200) NOT NULL,
`ticket_status_active` TINYINT(1) NOT NULL DEFAULT '1',
PRIMARY KEY (`ticket_status_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
--
-- Table structure for table `ticket_views`
--
@ -1875,4 +1878,4 @@ CREATE TABLE `vendors` (
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- As of 2024 03 29
-- Dump completed on 2024-03-30 15:05:47