Allow searching the main clients list by client tags.

- DB Change: Prefixed columns in client_tags table with client_tags_
- Updated existing SQL references to client_tags.client_id and client_tags.tag_id to new names
- clients.php: Added SQL joins/where/groupby logic to allow searching via tags
This commit is contained in:
Marcus Hill
2023-02-25 19:00:31 +00:00
parent 7805a8ee45
commit 67ea16e4fc
7 changed files with 37 additions and 22 deletions

View File

@@ -860,11 +860,20 @@ if (LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION) {
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.4.3'");
}
//if (CURRENT_DATABASE_VERSION == '0.4.3') {
// Insert queries here required to update to DB version 0.4.4
if (CURRENT_DATABASE_VERSION == '0.4.3') {
// Insert queries here required to update to DB version 0.4.4
mysqli_query($mysqli, "ALTER TABLE `client_tags` CHANGE `client_id` `client_tags_client_id` INT NOT NULL");
mysqli_query($mysqli, "ALTER TABLE `client_tags` CHANGE `tag_id` `client_tags_tag_id` INT NOT NULL");
// Then, update the database to the next sequential version
// mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.4.4'");
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.4.4'");
}
//if (CURRENT_DATABASE_VERSION == '0.4.4') {
// Insert queries here required to update to DB version 0.4.5
// Then, update the database to the next sequential version
// mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.4.5'");
//}
} else {