From 96c846a080e5396af9ed5e1ba3cf257b9f77585a Mon Sep 17 00:00:00 2001 From: johnnyq Date: Tue, 24 Jan 2023 16:19:49 -0500 Subject: [PATCH] Added fields to contacts for billing and technical contacts --- database_updates.php | 13 ++++++++++--- database_version.php | 2 +- db.sql | 4 +++- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/database_updates.php b/database_updates.php index 6c3c83f8..09ee055e 100644 --- a/database_updates.php +++ b/database_updates.php @@ -761,11 +761,18 @@ if(LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION){ mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.3.2'"); } - //if(CURRENT_DATABASE_VERSION == '0.3.2'){ - // Insert queries here required to update to DB version 0.3.3 + if(CURRENT_DATABASE_VERSION == '0.3.2'){ + mysqli_query($mysqli, "ALTER TABLE `contacts` ADD `contact_billing` TINYINT(1) DEFAULT 0 AFTER `contact_important`"); + mysqli_query($mysqli, "ALTER TABLE `contacts` ADD `contact_technical` TINYINT(1) DEFAULT 0 AFTER `contact_billing`"); + + mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.3.3'"); + } + + //if(CURRENT_DATABASE_VERSION == '0.3.3'){ + // Insert queries here required to update to DB version 0.3.4 // Then, update the database to the next sequential version - // mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.3.3'"); + // mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.3.4'"); //} diff --git a/database_version.php b/database_version.php index 759dcc56..e2f7de8c 100644 --- a/database_version.php +++ b/database_version.php @@ -5,4 +5,4 @@ * It is used in conjunction with database_updates.php */ -DEFINE("LATEST_DATABASE_VERSION", "0.3.2"); \ No newline at end of file +DEFINE("LATEST_DATABASE_VERSION", "0.3.3"); \ No newline at end of file diff --git a/db.sql b/db.sql index 5a02b3b4..4befe46d 100644 --- a/db.sql +++ b/db.sql @@ -344,6 +344,8 @@ CREATE TABLE `contacts` ( `contact_password_reset_token` varchar(200) DEFAULT NULL, `contact_token_expire` datetime DEFAULT NULL, `contact_important` tinyint(1) NOT NULL DEFAULT 0, + `contact_billing` tinyint(1) DEFAULT 0, + `contact_technical` tinyint(1) DEFAULT 0, `contact_created_at` datetime NOT NULL DEFAULT current_timestamp(), `contact_updated_at` datetime DEFAULT NULL ON UPDATE current_timestamp(), `contact_archived_at` datetime DEFAULT NULL, @@ -1516,4 +1518,4 @@ CREATE TABLE `vendors` ( /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2023-01-23 21:43:07 +-- Dump completed on 2023-01-24 16:19:14