mirror of https://github.com/itflow-org/itflow
DB Structure Update, added missing Short description fields to several entities, Added Event Attendees Table, Added event location, added db support support to link files with an asset, added db support to allow multiple contacts for a vendors
This commit is contained in:
parent
1a74acfbff
commit
4fec8efecd
|
|
@ -1647,16 +1647,50 @@ if (LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION) {
|
|||
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '1.1.1'");
|
||||
}
|
||||
|
||||
if (CURRENT_DATABASE_VERSION == '1.1.1') {
|
||||
mysqli_query($mysqli, "ALTER TABLE `scheduled_tickets` ADD `scheduled_ticket_assigned_to` INT(11) NOT NULL DEFAULT '0' AFTER `scheduled_ticket_created_by`");
|
||||
if (CURRENT_DATABASE_VERSION == '1.1.1') {
|
||||
mysqli_query($mysqli, "ALTER TABLE `scheduled_tickets` ADD `scheduled_ticket_assigned_to` INT(11) NOT NULL DEFAULT '0' AFTER `scheduled_ticket_created_by`");
|
||||
|
||||
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '1.1.2'");
|
||||
}
|
||||
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '1.1.2'");
|
||||
}
|
||||
|
||||
// if (CURRENT_DATABASE_VERSION == '1.1.2') {
|
||||
// // Insert queries here required to update to DB version 1.1.3
|
||||
if (CURRENT_DATABASE_VERSION == '1.1.2') {
|
||||
// Add DB support for multiple contacts under a vendor
|
||||
mysqli_query($mysqli, "ALTER TABLE `contacts` ADD `contact_vendor_id` INT(11) NOT NULL DEFAULT '0' AFTER `contact_location_id`");
|
||||
|
||||
// Add DB Support to Associate files to an asset example pictures, config backups etc
|
||||
mysqli_query($mysqli, "ALTER TABLE `files` ADD `file_asset_id` INT(11) NOT NULL DEFAULT '0' AFTER `file_folder_id`");
|
||||
|
||||
// Add DB Support for missing Short Description fields
|
||||
mysqli_query($mysqli, "ALTER TABLE `locations` ADD `location_description` TEXT DEFAULT NULL AFTER `location_name`");
|
||||
mysqli_query($mysqli, "ALTER TABLE `software` ADD `software_description` TEXT DEFAULT NULL AFTER `software_name`");
|
||||
mysqli_query($mysqli, "ALTER TABLE `networks` ADD `network_description` TEXT DEFAULT NULL AFTER `network_name`");
|
||||
mysqli_query($mysqli, "ALTER TABLE `certificates` ADD `certificate_description` TEXT DEFAULT NULL AFTER `certificate_name`");
|
||||
mysqli_query($mysqli, "ALTER TABLE `domains` ADD `domain_description` TEXT DEFAULT NULL AFTER `domain_name`");
|
||||
|
||||
// Add DB Support for Location for Events
|
||||
mysqli_query($mysqli, "ALTER TABLE `events` ADD `event_location` TEXT DEFAULT NULL AFTER `event_title`");
|
||||
|
||||
// Add Event Attendees Table to allow multiple Attendees per event
|
||||
mysqli_query($mysqli, "CREATE TABLE `event_attendees` (
|
||||
`attendee_id` INT(11) NOT NULL AUTO_INCREMENT,
|
||||
`attendee_name` VARCHAR(200) DEFAULT NULL,
|
||||
`attendee_email` VARCHAR(200) DEFAULT NULL,
|
||||
`attendee_invitation_status` TINYINT(1) DEFAULT 0,
|
||||
`attendee_created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP(),
|
||||
`attendee_updated_at` DATETIME DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
|
||||
`attendee_archived_at` DATETIME DEFAULT NULL,
|
||||
`attendee_contact_id` INT(11) NOT NULL DEFAULT 0,
|
||||
`attendee_event_id` INT(11) NOT NULL,
|
||||
PRIMARY KEY (`attendee_id`)
|
||||
)");
|
||||
|
||||
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '1.1.3'");
|
||||
}
|
||||
|
||||
// if (CURRENT_DATABASE_VERSION == '1.1.3') {
|
||||
// // Insert queries here required to update to DB version 1.1.4
|
||||
// // Then, update the database to the next sequential version
|
||||
// mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '1.1.3'");
|
||||
// mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '1.1.4'");
|
||||
// }
|
||||
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -5,5 +5,5 @@
|
|||
* It is used in conjunction with database_updates.php
|
||||
*/
|
||||
|
||||
DEFINE("LATEST_DATABASE_VERSION", "1.1.2");
|
||||
DEFINE("LATEST_DATABASE_VERSION", "1.1.3");
|
||||
|
||||
|
|
|
|||
33
db.sql
33
db.sql
|
|
@ -1,6 +1,6 @@
|
|||
-- MariaDB dump 10.19 Distrib 10.11.6-MariaDB, for debian-linux-gnu (x86_64)
|
||||
--
|
||||
-- Host: localhost Database: itflow_dev-
|
||||
-- Host: localhost Database: itflow_dev
|
||||
-- ------------------------------------------------------
|
||||
-- Server version 10.11.6-MariaDB-0+deb12u1
|
||||
|
||||
|
|
@ -226,6 +226,7 @@ DROP TABLE IF EXISTS `certificates`;
|
|||
CREATE TABLE `certificates` (
|
||||
`certificate_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`certificate_name` varchar(200) NOT NULL,
|
||||
`certificate_description` text DEFAULT NULL,
|
||||
`certificate_domain` varchar(200) DEFAULT NULL,
|
||||
`certificate_issued_by` varchar(200) NOT NULL,
|
||||
`certificate_expire` date DEFAULT NULL,
|
||||
|
|
@ -396,6 +397,7 @@ CREATE TABLE `contacts` (
|
|||
`contact_archived_at` datetime DEFAULT NULL,
|
||||
`contact_accessed_at` datetime DEFAULT NULL,
|
||||
`contact_location_id` int(11) NOT NULL DEFAULT 0,
|
||||
`contact_vendor_id` int(11) NOT NULL DEFAULT 0,
|
||||
`contact_department` varchar(200) DEFAULT NULL,
|
||||
`contact_client_id` int(11) NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (`contact_id`)
|
||||
|
|
@ -488,6 +490,7 @@ DROP TABLE IF EXISTS `domains`;
|
|||
CREATE TABLE `domains` (
|
||||
`domain_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`domain_name` varchar(200) NOT NULL,
|
||||
`domain_description` text DEFAULT NULL,
|
||||
`domain_expire` date DEFAULT NULL,
|
||||
`domain_ip` varchar(255) DEFAULT NULL,
|
||||
`domain_name_servers` varchar(255) DEFAULT NULL,
|
||||
|
|
@ -531,6 +534,27 @@ CREATE TABLE `email_queue` (
|
|||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Table structure for table `event_attendees`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `event_attendees`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `event_attendees` (
|
||||
`attendee_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`attendee_name` varchar(200) DEFAULT NULL,
|
||||
`attendee_email` varchar(200) DEFAULT NULL,
|
||||
`attendee_invitation_status` tinyint(1) DEFAULT 0,
|
||||
`attendee_created_at` datetime NOT NULL DEFAULT current_timestamp(),
|
||||
`attendee_updated_at` datetime DEFAULT NULL ON UPDATE current_timestamp(),
|
||||
`attendee_archived_at` datetime DEFAULT NULL,
|
||||
`attendee_contact_id` int(11) NOT NULL DEFAULT 0,
|
||||
`attendee_event_id` int(11) NOT NULL,
|
||||
PRIMARY KEY (`attendee_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
-- Table structure for table `events`
|
||||
--
|
||||
|
|
@ -541,6 +565,7 @@ DROP TABLE IF EXISTS `events`;
|
|||
CREATE TABLE `events` (
|
||||
`event_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`event_title` varchar(200) NOT NULL,
|
||||
`event_location` text DEFAULT NULL,
|
||||
`event_description` longtext DEFAULT NULL,
|
||||
`event_start` datetime NOT NULL,
|
||||
`event_end` datetime DEFAULT NULL,
|
||||
|
|
@ -602,6 +627,7 @@ CREATE TABLE `files` (
|
|||
`file_archived_at` datetime DEFAULT NULL,
|
||||
`file_accessed_at` datetime DEFAULT NULL,
|
||||
`file_folder_id` int(11) NOT NULL DEFAULT 0,
|
||||
`file_asset_id` int(11) NOT NULL DEFAULT 0,
|
||||
`file_client_id` int(11) NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (`file_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
|
|
@ -733,6 +759,7 @@ DROP TABLE IF EXISTS `locations`;
|
|||
CREATE TABLE `locations` (
|
||||
`location_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`location_name` varchar(200) NOT NULL,
|
||||
`location_description` text DEFAULT NULL,
|
||||
`location_country` varchar(200) DEFAULT NULL,
|
||||
`location_address` varchar(200) DEFAULT NULL,
|
||||
`location_city` varchar(200) DEFAULT NULL,
|
||||
|
|
@ -818,6 +845,7 @@ DROP TABLE IF EXISTS `networks`;
|
|||
CREATE TABLE `networks` (
|
||||
`network_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`network_name` varchar(200) NOT NULL,
|
||||
`network_description` text DEFAULT NULL,
|
||||
`network_vlan` int(11) DEFAULT NULL,
|
||||
`network` varchar(200) NOT NULL,
|
||||
`network_gateway` varchar(200) NOT NULL,
|
||||
|
|
@ -1340,6 +1368,7 @@ DROP TABLE IF EXISTS `software`;
|
|||
CREATE TABLE `software` (
|
||||
`software_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`software_name` varchar(200) NOT NULL,
|
||||
`software_description` text DEFAULT NULL,
|
||||
`software_version` varchar(200) DEFAULT NULL,
|
||||
`software_type` varchar(200) NOT NULL,
|
||||
`software_license_type` varchar(200) DEFAULT NULL,
|
||||
|
|
@ -1774,4 +1803,4 @@ CREATE TABLE `vendors` (
|
|||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
-- Dump completed on 2024-03-15 18:31:42
|
||||
-- Dump completed on 2024-03-19 17:07:09
|
||||
|
|
|
|||
Loading…
Reference in New Issue