Added asset history table

This commit is contained in:
johnnyq
2024-10-29 18:16:28 -04:00
parent c3379a5576
commit f52beed3d0
3 changed files with 36 additions and 5 deletions

View File

@@ -2315,11 +2315,25 @@ if (LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION) {
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '1.6.0'"); mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '1.6.0'");
} }
if (CURRENT_DATABASE_VERSION == '1.6.0') {
// if (CURRENT_DATABASE_VERSION == '1.6.0') { mysqli_query($mysqli, "CREATE TABLE `asset_history` (
// // Insert queries here required to update to DB version 1.6.1 `asset_history_id` INT(11) NOT NULL AUTO_INCREMENT,
`asset_history_status` VARCHAR(200) NOT NULL,
`asset_history_description` VARCHAR(255) NOT NULL,
`asset_history_created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
`asset_history_asset_id` INT(11) NOT NULL,
PRIMARY KEY (`asset_history_id`)
)");
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '1.6.1'");
}
// if (CURRENT_DATABASE_VERSION == '1.6.1') {
// // Insert queries here required to update to DB version 1.6.2
// // Then, update the database to the next sequential version // // Then, update the database to the next sequential version
// mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '1.6.1'"); // mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '1.6.2'");
// } // }
} else { } else {

View File

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

19
db.sql
View File

@@ -100,6 +100,23 @@ CREATE TABLE `asset_files` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `asset_history`
--
DROP TABLE IF EXISTS `asset_history`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `asset_history` (
`asset_history_id` int(11) NOT NULL AUTO_INCREMENT,
`asset_history_status` varchar(200) NOT NULL,
`asset_history_description` varchar(255) NOT NULL,
`asset_history_created_at` datetime NOT NULL DEFAULT current_timestamp(),
`asset_history_asset_id` int(11) NOT NULL,
PRIMARY KEY (`asset_history_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
-- --
-- Table structure for table `asset_interfaces` -- Table structure for table `asset_interfaces`
-- --
@@ -2115,4 +2132,4 @@ CREATE TABLE `vendors` (
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2024-10-29 15:40:54 -- Dump completed on 2024-10-29 18:15:37