From 1dfc8196603172d3fb3d4da404fc52c87a363f25 Mon Sep 17 00:00:00 2001 From: johnnyq Date: Tue, 5 Mar 2024 18:48:34 -0500 Subject: [PATCH] Add Transfer Method to the Database this will in the method to transfer money from 1 account to another --- database_updates.php | 12 +++++++++--- database_version.php | 2 +- db.sql | 3 ++- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/database_updates.php b/database_updates.php index d8ca049f..f509e09a 100644 --- a/database_updates.php +++ b/database_updates.php @@ -1630,10 +1630,16 @@ if (LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION) { mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '1.0.9'"); } - // if (CURRENT_DATABASE_VERSION == '1.0.9') { - // // Insert queries here required to update to DB version 1.1.0 + if (CURRENT_DATABASE_VERSION == '1.0.9') { + mysqli_query($mysqli, "ALTER TABLE `transfers` ADD `transfer_method` VARCHAR(200) DEFAULT NULL AFTER `transfer_id`"); + + mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '1.1.0'"); + } + + // if (CURRENT_DATABASE_VERSION == '1.1.0') { + // // Insert queries here required to update to DB version 1.1.1 // // Then, update the database to the next sequential version - // mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '1.1.0'"); + // mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '1.1.1'"); // } } else { diff --git a/database_version.php b/database_version.php index c2981735..c33ccb54 100644 --- a/database_version.php +++ b/database_version.php @@ -5,5 +5,5 @@ * It is used in conjunction with database_updates.php */ -DEFINE("LATEST_DATABASE_VERSION", "1.0.9"); +DEFINE("LATEST_DATABASE_VERSION", "1.1.0"); diff --git a/db.sql b/db.sql index f5aa8fcc..d0f5546e 100644 --- a/db.sql +++ b/db.sql @@ -1606,6 +1606,7 @@ DROP TABLE IF EXISTS `transfers`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `transfers` ( `transfer_id` int(11) NOT NULL AUTO_INCREMENT, + `transfer_method` varchar(200) DEFAULT NULL, `transfer_notes` text DEFAULT NULL, `transfer_created_at` datetime NOT NULL DEFAULT current_timestamp(), `transfer_updated_at` datetime DEFAULT NULL ON UPDATE current_timestamp(), @@ -1768,4 +1769,4 @@ CREATE TABLE `vendors` ( /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2024-03-03 13:39:52 +-- Dump completed on 2024-03-05 18:47:45