From 114a72424ca805bb7b172acb95895ef701fd6bc1 Mon Sep 17 00:00:00 2001 From: Marcus Hill Date: Sun, 31 Dec 2023 10:34:01 +0000 Subject: [PATCH] Add domain_notes database field --- database_updates.php | 20 ++++++++++++++------ database_version.php | 2 +- db.sql | 1 + 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/database_updates.php b/database_updates.php index 66f9ef79..1ba8ada7 100644 --- a/database_updates.php +++ b/database_updates.php @@ -1418,7 +1418,7 @@ if (LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION) { // // Then, update the database to the next sequential version mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.8.9'"); - } + } if (CURRENT_DATABASE_VERSION == '0.8.9') { @@ -1452,7 +1452,7 @@ if (LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION) { mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Recurring', log_action = 'Modify', log_description = 'Updated item_order to item_id: $item_order'"); } } - + // // Then, update the database to the next sequential version @@ -1495,7 +1495,7 @@ if (LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION) { if (CURRENT_DATABASE_VERSION == '0.9.4') { // Insert queries here required to update to DB version 0.9.5 - mysqli_query($mysqli, "ALTER TABLE `settings` ADD `config_stripe_client_pays_fees` TINYINT(1) NOT NULL DEFAULT 0 AFTER `config_stripe_account`"); + mysqli_query($mysqli, "ALTER TABLE `settings` ADD `config_stripe_client_pays_fees` TINYINT(1) NOT NULL DEFAULT 0 AFTER `config_stripe_account`"); // Then, update the database to the next sequential version mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.9.5'"); } @@ -1524,14 +1524,22 @@ if (LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION) { mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.9.8'"); } + if (CURRENT_DATABASE_VERSION == '0.9.8') { + //Insert queries here required to update to DB version 0.9.9 + mysqli_query($mysqli, "ALTER TABLE `domains` ADD `domain_notes` TEXT NULL DEFAULT NULL AFTER `domain_raw_whois`"); + + //Then, update the database to the next sequential version + mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.9.9'"); + } + // 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 == '0.9.8') { - // // Insert queries here required to update to DB version 0.9.9 + // if (CURRENT_DATABASE_VERSION == '0.9.9') { + // // Insert queries here required to update to DB version 0.10.0 // // Then, update the database to the next sequential version - // mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.9.9'"); + // mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.10.0'"); // } } else { diff --git a/database_version.php b/database_version.php index 55f0278b..0e02bd3d 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", "0.9.8"); +DEFINE("LATEST_DATABASE_VERSION", "0.9.9"); diff --git a/db.sql b/db.sql index b7590423..3f8f6da8 100644 --- a/db.sql +++ b/db.sql @@ -505,6 +505,7 @@ CREATE TABLE `domains` ( `domain_mail_servers` varchar(255) DEFAULT NULL, `domain_txt` text DEFAULT NULL, `domain_raw_whois` text DEFAULT NULL, + `domain_notes` text DEFAULT NULL, `domain_created_at` datetime NOT NULL DEFAULT current_timestamp(), `domain_updated_at` datetime DEFAULT NULL ON UPDATE current_timestamp(), `domain_archived_at` datetime DEFAULT NULL,