Skip to content

Commit

Permalink
DB Update add user_role_type to differentiate between itflow users, c…
Browse files Browse the repository at this point in the history
…lient users and api permissions
  • Loading branch information
johnnyq committed Oct 22, 2024
1 parent 48b3064 commit 499f945
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
11 changes: 8 additions & 3 deletions database_updates.php
Original file line number Diff line number Diff line change
Expand Up @@ -2242,10 +2242,15 @@
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 {
Expand Down
2 changes: 1 addition & 1 deletion database_version.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 changes: 3 additions & 1 deletion db.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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

0 comments on commit 499f945

Please sign in to comment.