DB Update add user_role_type to differentiate between itflow users, client users and api permissions

This commit is contained in:
johnnyq 2024-10-22 14:08:50 -04:00
parent 48b306452c
commit 499f9456f8
3 changed files with 12 additions and 5 deletions

View File

@ -2242,10 +2242,15 @@ if (LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION) {
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '1.5.4'");
}
// if (CURRENT_DATABASE_VERSION == '1.5.4') {
// // Insert queries here required to update to DB version 1.5.5
if (CURRENT_DATABASE_VERSION == '1.5.4') {
mysqli_query($mysqli, "ALTER TABLE `user_roles` ADD `user_role_type` TINYINT(1) NOT NULL DEFAULT 1 AFTER `user_role_description`");
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '1.5.5'");
}
// if (CURRENT_DATABASE_VERSION == '1.5.5') {
// // Insert queries here required to update to DB version 1.5.6
// // Then, update the database to the next sequential version
// mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '1.5.5'");
// mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '1.5.6'");
// }
} else {

View File

@ -5,4 +5,4 @@
* It is used in conjunction with database_updates.php
*/
DEFINE("LATEST_DATABASE_VERSION", "1.5.4");
DEFINE("LATEST_DATABASE_VERSION", "1.5.5");

4
db.sql
View File

@ -1975,6 +1975,7 @@ CREATE TABLE `user_roles` (
`user_role_id` int(11) NOT NULL AUTO_INCREMENT,
`user_role_name` varchar(200) NOT NULL,
`user_role_description` varchar(200) DEFAULT NULL,
`user_role_type` tinyint(1) NOT NULL DEFAULT 1,
`user_role_is_admin` tinyint(1) NOT NULL DEFAULT 0,
`user_role_created_at` datetime NOT NULL DEFAULT current_timestamp(),
`user_role_updated_at` datetime DEFAULT NULL ON UPDATE current_timestamp(),
@ -2014,6 +2015,7 @@ CREATE TABLE `users` (
`user_name` varchar(200) NOT NULL,
`user_email` varchar(200) NOT NULL,
`user_password` varchar(200) NOT NULL,
`user_type` tinyint(1) NOT NULL DEFAULT 1,
`user_status` tinyint(1) NOT NULL DEFAULT 1,
`user_token` varchar(200) DEFAULT NULL,
`user_avatar` varchar(200) DEFAULT NULL,
@ -2110,4 +2112,4 @@ CREATE TABLE `vendors` (
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2024-09-18 18:21:54
-- Dump completed on 2024-10-22 14:08:06