diff --git a/database_updates.php b/database_updates.php index f4d1759e..1f9d22e7 100644 --- a/database_updates.php +++ b/database_updates.php @@ -2222,10 +2222,19 @@ if (LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION) { mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '1.5.1'"); } - // if (CURRENT_DATABASE_VERSION == '1.5.1') { - // // Insert queries here required to update to DB version 1.5.2 + if (CURRENT_DATABASE_VERSION == '1.5.1') { + + mysqli_query($mysqli, "ALTER TABLE `custom_links` ADD `custom_link_location` INT(11) NOT NULL DEFAULT 1 AFTER `custom_link_icon`"); + mysqli_query($mysqli, "ALTER TABLE `custom_links` ADD `custom_link_new_tab` TINYINT(1) NOT NULL DEFAULT 0 AFTER `custom_link_uri`"); + mysqli_query($mysqli, "ALTER TABLE `custom_links` ADD `custom_link_order` INT(11) NOT NULL DEFAULT 0 AFTER `custom_link_location`"); + + mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '1.5.2'"); + } + + // if (CURRENT_DATABASE_VERSION == '1.5.2') { + // // Insert queries here required to update to DB version 1.5.3 // // Then, update the database to the next sequential version - // mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '1.5.2'"); + // mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '1.5.3'"); // } } else { diff --git a/database_version.php b/database_version.php index 0ec19e2b..f61c2d69 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", "1.5.1"); +DEFINE("LATEST_DATABASE_VERSION", "1.5.2"); diff --git a/db.sql b/db.sql index dc504553..6686b336 100644 --- a/db.sql +++ b/db.sql @@ -456,7 +456,10 @@ CREATE TABLE `custom_links` ( `custom_link_name` varchar(200) NOT NULL, `custom_link_description` text DEFAULT NULL, `custom_link_uri` varchar(500) NOT NULL, + `custom_link_new_tab` tinyint(1) NOT NULL DEFAULT 0, `custom_link_icon` varchar(200) DEFAULT NULL, + `custom_link_location` int(11) NOT NULL DEFAULT 1, + `custom_link_order` int(11) NOT NULL DEFAULT 0, `custom_link_created_at` datetime NOT NULL DEFAULT current_timestamp(), `custom_link_updated_at` datetime DEFAULT NULL ON UPDATE current_timestamp(), `custom_link_archived_at` datetime DEFAULT NULL, @@ -2106,4 +2109,4 @@ CREATE TABLE `vendors` ( /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2024-09-18 16:29:56 +-- Dump completed on 2024-09-18 18:21:54