From d9a99b8d939b7a592940a55c43e04c9cbbc9950c Mon Sep 17 00:00:00 2001 From: johnnyq Date: Sun, 14 Jan 2024 14:09:15 -0500 Subject: [PATCH] Increase the Asset URI limit from 250 to 500 and added asset URI 2 field for additional Asset URIs --- database_updates.php | 15 ++++++++++++--- database_version.php | 2 +- db.sql | 5 +++-- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/database_updates.php b/database_updates.php index ce38b2e2..82d7e719 100644 --- a/database_updates.php +++ b/database_updates.php @@ -1540,14 +1540,23 @@ if (LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION) { mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '1.0.0'"); } + if (CURRENT_DATABASE_VERSION == '1.0.0') { + //Insert queries here required to update to DB version 1.0.1 + mysqli_query($mysqli, "ALTER TABLE `assets` MODIFY `asset_uri` VARCHAR(500) DEFAULT NULL"); + mysqli_query($mysqli, "ALTER TABLE `assets` ADD `asset_uri_2` VARCHAR(500) DEFAULT NULL AFTER `asset_uri`"); + + //Then, update the database to the next sequential version + mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '1.0.1'"); + } + // Be sure to change database_version.php to reflect the version you are updating to here // Please add this same comment block to the bottom of this file, and update the version number. // Uncomment Below Lines, to add additional database updates // - // if (CURRENT_DATABASE_VERSION == '1.0.0') { - // // Insert queries here required to update to DB version 1.0.1 + // if (CURRENT_DATABASE_VERSION == '1.0.1') { + // // Insert queries here required to update to DB version 1.0.2 // // Then, update the database to the next sequential version - // mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '1.1.1'"); + // mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '1.0.2'"); // } } else { diff --git a/database_version.php b/database_version.php index a7a46617..79278684 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.0"); +DEFINE("LATEST_DATABASE_VERSION", "1.0.1"); diff --git a/db.sql b/db.sql index 47012483..62050e3a 100644 --- a/db.sql +++ b/db.sql @@ -149,7 +149,8 @@ CREATE TABLE `assets` ( `asset_os` varchar(200) DEFAULT NULL, `asset_ip` varchar(20) DEFAULT NULL, `asset_mac` varchar(17) DEFAULT NULL, - `asset_uri` varchar(250) DEFAULT NULL, + `asset_uri` varchar(500) DEFAULT NULL, + `asset_uri_2` varchar(500) DEFAULT NULL, `asset_status` varchar(200) DEFAULT NULL, `asset_purchase_date` date DEFAULT NULL, `asset_warranty_expire` date DEFAULT NULL, @@ -1753,4 +1754,4 @@ CREATE TABLE `vendors` ( /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2024-01-06 16:07:08 +-- Dump completed on 2024-01-14 14:08:41