DB update for the upcoming user client restricted access permissions

This commit is contained in:
johnnyq 2024-05-10 11:34:25 -04:00
parent 3b8f36e8f3
commit a41eede52f
3 changed files with 27 additions and 6 deletions

View File

@ -1886,10 +1886,17 @@ if (LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION) {
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '1.2.9'");
}
// if (CURRENT_DATABASE_VERSION == '1.2.9') {
// // Insert queries here required to update to DB version 1.2.10
if (CURRENT_DATABASE_VERSION == '1.2.9') {
mysqli_query($mysqli, "CREATE TABLE `user_permissions` (`user_id` int(11) NOT NULL,`client_id` int(11) NOT NULL, PRIMARY KEY (`user_id`,`client_id`))");
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '1.3.0'");
}
// if (CURRENT_DATABASE_VERSION == '1.3.0') {
// // Insert queries here required to update to DB version 1.3.0
// // Then, update the database to the next sequential version
// mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '1.2.10");
// mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '1.3.1");
// }
} else {

View File

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

18
db.sql
View File

@ -1375,7 +1375,7 @@ CREATE TABLE `settings` (
`config_telemetry` tinyint(1) DEFAULT 0,
`config_timezone` varchar(200) NOT NULL DEFAULT 'America/New_York',
`config_destructive_deletes_enable` tinyint(1) NOT NULL DEFAULT 0,
`config_phone_number` tinyint(1) NOT NULL DEFAULT 1,
`config_phone_mask` tinyint(1) NOT NULL DEFAULT 1,
PRIMARY KEY (`company_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
@ -1777,6 +1777,20 @@ CREATE TABLE `trips` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `user_permissions`
--
DROP TABLE IF EXISTS `user_permissions`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user_permissions` (
`user_id` int(11) NOT NULL,
`client_id` int(11) NOT NULL,
PRIMARY KEY (`user_id`,`client_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `user_settings`
--
@ -1903,4 +1917,4 @@ CREATE TABLE `vendors` (
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2024-04-12 19:37:23
-- Dump completed on 2024-05-10 11:33:39