DB Structure Update This is the beginnings to move primary_contact and primary_location fields out of the clients table and into their respectable table. Created the fields in contacts and locations, next is to write SQL query to migrate and then update pieces of the codes in the App

This commit is contained in:
johnnyq
2023-07-03 16:40:45 -04:00
parent 66ec189fae
commit b12e3677bd
3 changed files with 14 additions and 5 deletions

View File

@@ -1097,11 +1097,18 @@ if (LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION) {
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.5.8'");
}
//if (CURRENT_DATABASE_VERSION == '0.5.8') {
//Insert queries here required to update to DB version 0.5.9
if (CURRENT_DATABASE_VERSION == '0.5.8') {
mysqli_query($mysqli, "ALTER TABLE `contacts` ADD `contact_primary` TINYINT(1) NOT NULL DEFAULT 0 AFTER `contact_token_expire`");
mysqli_query($mysqli, "ALTER TABLE `locations` ADD `location_primary` TINYINT(1) NOT NULL DEFAULT 0 AFTER `location_photo`");
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.5.9'");
}
//if (CURRENT_DATABASE_VERSION == '0.5.9') {
//Insert queries here required to update to DB version 0.6.0
// Then, update the database to the next sequential version
//mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.5.9'");
//mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.6.0'");
//}
} else {