mirror of https://github.com/itflow-org/itflow
Ensure all Tables and fields use CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci
This commit is contained in:
parent
cc0b2126ba
commit
5a64bd3a32
|
|
@ -3339,10 +3339,44 @@ if (LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION) {
|
|||
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '2.0.5'");
|
||||
}
|
||||
|
||||
// if (CURRENT_DATABASE_VERSION == '2.0.5') {
|
||||
// // Insert queries here required to update to DB version 2.0.6
|
||||
if (CURRENT_DATABASE_VERSION == '2.0.5') {
|
||||
|
||||
// CONVERT All tables TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci
|
||||
|
||||
$tables = [
|
||||
'accounts', 'api_keys', 'app_logs', 'asset_credentials', 'asset_custom', 'asset_documents',
|
||||
'asset_files', 'asset_history', 'asset_interface_links', 'asset_interfaces', 'asset_notes', 'assets',
|
||||
'auth_logs', 'budget', 'calendar_event_attendees', 'calendar_events', 'calendars', 'categories',
|
||||
'certificate_history', 'certificates', 'client_notes', 'client_stripe', 'client_tags', 'clients',
|
||||
'companies', 'contact_assets', 'contact_credentials', 'contact_documents', 'contact_files', 'contact_notes',
|
||||
'contact_tags', 'contacts', 'credential_tags', 'credentials', 'custom_fields', 'custom_links',
|
||||
'custom_values', 'document_files', 'documents', 'domain_history', 'domains', 'email_queue', 'expenses',
|
||||
'files', 'folders', 'history', 'invoice_items', 'invoices', 'location_tags', 'locations', 'logs',
|
||||
'modules', 'networks', 'notifications', 'payments', 'products', 'project_template_ticket_templates',
|
||||
'project_templates', 'projects', 'quote_files', 'quotes', 'rack_units', 'racks', 'records',
|
||||
'recurring_expenses', 'recurring_invoices', 'recurring_payments', 'recurring_ticket_assets', 'recurring_tickets',
|
||||
'remember_tokens', 'revenues', 'service_assets', 'service_certificates', 'service_contacts', 'service_credentials',
|
||||
'service_documents', 'service_domains', 'service_vendors', 'services', 'settings', 'shared_items',
|
||||
'software', 'software_assets', 'software_contacts', 'software_credentials', 'software_documents', 'software_files',
|
||||
'tags', 'task_templates', 'tasks', 'taxes', 'ticket_assets', 'ticket_attachments', 'ticket_history', 'ticket_replies',
|
||||
'ticket_statuses', 'ticket_templates', 'ticket_views', 'ticket_watchers', 'tickets', 'transfers', 'trips',
|
||||
'user_client_permissions', 'user_role_permissions', 'user_roles', 'user_settings', 'users', 'vendor_credentials',
|
||||
'vendor_documents', 'vendor_files', 'vendors'
|
||||
];
|
||||
|
||||
foreach ($tables as $table) {
|
||||
$sql = "ALTER TABLE `$table` CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;";
|
||||
mysqli_query($mysqli, $sql);
|
||||
}
|
||||
|
||||
|
||||
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '2.0.6'");
|
||||
}
|
||||
|
||||
// if (CURRENT_DATABASE_VERSION == '2.0.6') {
|
||||
// // Insert queries here required to update to DB version 2.0.7
|
||||
// // Then, update the database to the next sequential version
|
||||
// mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '2.0.6'");
|
||||
// mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '2.0.7'");
|
||||
// }
|
||||
|
||||
} else {
|
||||
|
|
|
|||
126
db.sql
126
db.sql
|
|
@ -53,7 +53,7 @@ CREATE TABLE `api_keys` (
|
|||
`api_key_expire` date NOT NULL,
|
||||
`api_key_client_id` int(11) NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (`api_key_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
|
|
@ -105,7 +105,7 @@ CREATE TABLE `asset_custom` (
|
|||
PRIMARY KEY (`asset_custom_id`),
|
||||
KEY `asset_custom_asset_id` (`asset_custom_asset_id`),
|
||||
CONSTRAINT `asset_custom_ibfk_1` FOREIGN KEY (`asset_custom_asset_id`) REFERENCES `assets` (`asset_id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
|
|
@ -122,7 +122,7 @@ CREATE TABLE `asset_documents` (
|
|||
KEY `document_id` (`document_id`),
|
||||
CONSTRAINT `asset_documents_ibfk_1` FOREIGN KEY (`asset_id`) REFERENCES `assets` (`asset_id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `asset_documents_ibfk_2` FOREIGN KEY (`document_id`) REFERENCES `documents` (`document_id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
|
|
@ -139,7 +139,7 @@ CREATE TABLE `asset_files` (
|
|||
KEY `file_id` (`file_id`),
|
||||
CONSTRAINT `asset_files_ibfk_1` FOREIGN KEY (`asset_id`) REFERENCES `assets` (`asset_id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `asset_files_ibfk_2` FOREIGN KEY (`file_id`) REFERENCES `files` (`file_id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
|
|
@ -310,7 +310,7 @@ CREATE TABLE `budget` (
|
|||
`budget_updated_at` datetime DEFAULT NULL ON UPDATE current_timestamp(),
|
||||
`budget_category_id` int(11) NOT NULL,
|
||||
PRIMARY KEY (`budget_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
|
|
@ -419,7 +419,7 @@ CREATE TABLE `certificate_history` (
|
|||
PRIMARY KEY (`certificate_history_id`),
|
||||
KEY `certificate_history_certificate_id` (`certificate_history_certificate_id`),
|
||||
CONSTRAINT `certificate_history_ibfk_1` FOREIGN KEY (`certificate_history_certificate_id`) REFERENCES `certificates` (`certificate_id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
|
|
@ -432,12 +432,12 @@ 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_description` mediumtext DEFAULT NULL,
|
||||
`certificate_domain` varchar(200) DEFAULT NULL,
|
||||
`certificate_issued_by` varchar(200) NOT NULL,
|
||||
`certificate_expire` date DEFAULT NULL,
|
||||
`certificate_public_key` text DEFAULT NULL,
|
||||
`certificate_notes` text DEFAULT NULL,
|
||||
`certificate_public_key` mediumtext DEFAULT NULL,
|
||||
`certificate_notes` mediumtext DEFAULT NULL,
|
||||
`certificate_created_at` datetime NOT NULL DEFAULT current_timestamp(),
|
||||
`certificate_updated_at` datetime DEFAULT NULL ON UPDATE current_timestamp(),
|
||||
`certificate_archived_at` datetime DEFAULT NULL,
|
||||
|
|
@ -445,7 +445,7 @@ CREATE TABLE `certificates` (
|
|||
`certificate_domain_id` int(11) NOT NULL DEFAULT 0,
|
||||
`certificate_client_id` int(11) NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (`certificate_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
|
|
@ -482,7 +482,7 @@ CREATE TABLE `client_stripe` (
|
|||
`stripe_id` varchar(255) NOT NULL,
|
||||
`stripe_pm` varchar(255) DEFAULT NULL,
|
||||
PRIMARY KEY (`client_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
|
|
@ -499,7 +499,7 @@ CREATE TABLE `client_tags` (
|
|||
KEY `tag_id` (`tag_id`),
|
||||
CONSTRAINT `client_tags_ibfk_1` FOREIGN KEY (`client_id`) REFERENCES `clients` (`client_id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `client_tags_ibfk_2` FOREIGN KEY (`tag_id`) REFERENCES `tags` (`tag_id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
|
|
@ -573,7 +573,7 @@ CREATE TABLE `contact_assets` (
|
|||
CONSTRAINT `contact_assets_ibfk_2` FOREIGN KEY (`asset_id`) REFERENCES `assets` (`asset_id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `contact_assets_ibfk_3` FOREIGN KEY (`contact_id`) REFERENCES `contacts` (`contact_id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `contact_assets_ibfk_4` FOREIGN KEY (`asset_id`) REFERENCES `assets` (`asset_id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
|
|
@ -590,7 +590,7 @@ CREATE TABLE `contact_credentials` (
|
|||
KEY `credential_id` (`credential_id`),
|
||||
CONSTRAINT `contact_credentials_ibfk_1` FOREIGN KEY (`contact_id`) REFERENCES `contacts` (`contact_id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `contact_credentials_ibfk_2` FOREIGN KEY (`credential_id`) REFERENCES `credentials` (`credential_id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
|
|
@ -607,7 +607,7 @@ CREATE TABLE `contact_documents` (
|
|||
KEY `document_id` (`document_id`),
|
||||
CONSTRAINT `contact_documents_ibfk_1` FOREIGN KEY (`contact_id`) REFERENCES `contacts` (`contact_id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `contact_documents_ibfk_2` FOREIGN KEY (`document_id`) REFERENCES `documents` (`document_id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
|
|
@ -624,7 +624,7 @@ CREATE TABLE `contact_files` (
|
|||
KEY `file_id` (`file_id`),
|
||||
CONSTRAINT `contact_files_ibfk_1` FOREIGN KEY (`contact_id`) REFERENCES `contacts` (`contact_id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `contact_files_ibfk_2` FOREIGN KEY (`file_id`) REFERENCES `files` (`file_id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
|
|
@ -765,7 +765,7 @@ CREATE TABLE `custom_fields` (
|
|||
`custom_field_location` int(11) NOT NULL DEFAULT 0,
|
||||
`custom_field_order` int(11) NOT NULL DEFAULT 999,
|
||||
PRIMARY KEY (`custom_field_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
|
|
@ -800,10 +800,10 @@ DROP TABLE IF EXISTS `custom_values`;
|
|||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `custom_values` (
|
||||
`custom_value_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`custom_value_value` text NOT NULL,
|
||||
`custom_value_value` mediumtext NOT NULL,
|
||||
`custom_value_field` int(11) NOT NULL,
|
||||
PRIMARY KEY (`custom_value_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
|
|
@ -820,7 +820,7 @@ CREATE TABLE `document_files` (
|
|||
KEY `file_id` (`file_id`),
|
||||
CONSTRAINT `document_files_ibfk_1` FOREIGN KEY (`document_id`) REFERENCES `documents` (`document_id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `document_files_ibfk_2` FOREIGN KEY (`file_id`) REFERENCES `files` (`file_id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
|
|
@ -870,7 +870,7 @@ CREATE TABLE `domain_history` (
|
|||
PRIMARY KEY (`domain_history_id`),
|
||||
KEY `domain_history_domain_id` (`domain_history_domain_id`),
|
||||
CONSTRAINT `domain_history_ibfk_1` FOREIGN KEY (`domain_history_domain_id`) REFERENCES `domains` (`domain_id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
|
|
@ -926,7 +926,7 @@ CREATE TABLE `email_queue` (
|
|||
`email_attempts` tinyint(1) NOT NULL DEFAULT 0,
|
||||
`email_sent_at` datetime DEFAULT NULL,
|
||||
PRIMARY KEY (`email_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
|
|
@ -1001,7 +1001,7 @@ CREATE TABLE `folders` (
|
|||
`folder_location` int(11) DEFAULT 0,
|
||||
`folder_client_id` int(11) NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (`folder_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
|
|
@ -1309,7 +1309,7 @@ CREATE TABLE `projects` (
|
|||
`project_prefix` varchar(200) DEFAULT NULL,
|
||||
`project_number` int(11) NOT NULL DEFAULT 1,
|
||||
`project_name` varchar(255) NOT NULL,
|
||||
`project_description` text DEFAULT NULL,
|
||||
`project_description` mediumtext DEFAULT NULL,
|
||||
`project_due` date DEFAULT NULL,
|
||||
`project_manager` int(11) NOT NULL DEFAULT 0,
|
||||
`project_created_at` datetime NOT NULL DEFAULT current_timestamp(),
|
||||
|
|
@ -1318,7 +1318,7 @@ CREATE TABLE `projects` (
|
|||
`project_archived_at` datetime DEFAULT NULL,
|
||||
`project_client_id` int(11) NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (`project_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
|
|
@ -1435,7 +1435,7 @@ CREATE TABLE `records` (
|
|||
`record_archived_at` datetime DEFAULT NULL,
|
||||
`record_domain_id` int(11) NOT NULL,
|
||||
PRIMARY KEY (`record_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
|
|
@ -1453,7 +1453,7 @@ CREATE TABLE `recurring_expenses` (
|
|||
`recurring_expense_last_sent` date DEFAULT NULL,
|
||||
`recurring_expense_next_date` date NOT NULL,
|
||||
`recurring_expense_status` tinyint(1) NOT NULL DEFAULT 1,
|
||||
`recurring_expense_description` text DEFAULT NULL,
|
||||
`recurring_expense_description` mediumtext DEFAULT NULL,
|
||||
`recurring_expense_amount` decimal(15,2) NOT NULL,
|
||||
`recurring_expense_payment_method` varchar(200) DEFAULT NULL,
|
||||
`recurring_expense_reference` varchar(255) DEFAULT NULL,
|
||||
|
|
@ -1466,7 +1466,7 @@ CREATE TABLE `recurring_expenses` (
|
|||
`recurring_expense_category_id` int(11) NOT NULL,
|
||||
`recurring_expense_account_id` int(11) NOT NULL,
|
||||
PRIMARY KEY (`recurring_expense_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
|
|
@ -1546,11 +1546,11 @@ DROP TABLE IF EXISTS `recurring_tickets`;
|
|||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `recurring_tickets` (
|
||||
`recurring_ticket_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`recurring_ticket_category` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||
`recurring_ticket_subject` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||
`recurring_ticket_details` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||
`recurring_ticket_priority` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||
`recurring_ticket_frequency` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||
`recurring_ticket_category` varchar(200) DEFAULT NULL,
|
||||
`recurring_ticket_subject` varchar(500) NOT NULL,
|
||||
`recurring_ticket_details` longtext NOT NULL,
|
||||
`recurring_ticket_priority` varchar(200) DEFAULT NULL,
|
||||
`recurring_ticket_frequency` varchar(10) NOT NULL,
|
||||
`recurring_ticket_billable` tinyint(1) NOT NULL DEFAULT 0,
|
||||
`recurring_ticket_start_date` date NOT NULL,
|
||||
`recurring_ticket_next_run` date NOT NULL,
|
||||
|
|
@ -1562,7 +1562,7 @@ CREATE TABLE `recurring_tickets` (
|
|||
`recurring_ticket_contact_id` int(11) NOT NULL DEFAULT 0,
|
||||
`recurring_ticket_asset_id` int(11) NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (`recurring_ticket_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
|
|
@ -1603,7 +1603,7 @@ CREATE TABLE `revenues` (
|
|||
`revenue_account_id` int(11) NOT NULL,
|
||||
`revenue_client_id` int(11) NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (`revenue_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
|
|
@ -1620,7 +1620,7 @@ CREATE TABLE `service_assets` (
|
|||
KEY `asset_id` (`asset_id`),
|
||||
CONSTRAINT `service_assets_ibfk_1` FOREIGN KEY (`service_id`) REFERENCES `services` (`service_id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `service_assets_ibfk_2` FOREIGN KEY (`asset_id`) REFERENCES `assets` (`asset_id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
|
|
@ -1637,7 +1637,7 @@ CREATE TABLE `service_certificates` (
|
|||
KEY `certificate_id` (`certificate_id`),
|
||||
CONSTRAINT `service_certificates_ibfk_1` FOREIGN KEY (`service_id`) REFERENCES `services` (`service_id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `service_certificates_ibfk_2` FOREIGN KEY (`certificate_id`) REFERENCES `certificates` (`certificate_id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
|
|
@ -1654,7 +1654,7 @@ CREATE TABLE `service_contacts` (
|
|||
KEY `contact_id` (`contact_id`),
|
||||
CONSTRAINT `service_contacts_ibfk_1` FOREIGN KEY (`service_id`) REFERENCES `services` (`service_id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `service_contacts_ibfk_2` FOREIGN KEY (`contact_id`) REFERENCES `contacts` (`contact_id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
|
|
@ -1671,7 +1671,7 @@ CREATE TABLE `service_credentials` (
|
|||
KEY `credential_id` (`credential_id`),
|
||||
CONSTRAINT `service_credentials_ibfk_1` FOREIGN KEY (`service_id`) REFERENCES `services` (`service_id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `service_credentials_ibfk_2` FOREIGN KEY (`credential_id`) REFERENCES `credentials` (`credential_id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
|
|
@ -1688,7 +1688,7 @@ CREATE TABLE `service_documents` (
|
|||
KEY `document_id` (`document_id`),
|
||||
CONSTRAINT `service_documents_ibfk_1` FOREIGN KEY (`service_id`) REFERENCES `services` (`service_id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `service_documents_ibfk_2` FOREIGN KEY (`document_id`) REFERENCES `documents` (`document_id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
|
|
@ -1703,7 +1703,7 @@ CREATE TABLE `service_domains` (
|
|||
`domain_id` int(11) NOT NULL,
|
||||
KEY `service_id` (`service_id`),
|
||||
KEY `domain_id` (`domain_id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
|
|
@ -1720,7 +1720,7 @@ CREATE TABLE `service_vendors` (
|
|||
KEY `vendor_id` (`vendor_id`),
|
||||
CONSTRAINT `service_vendors_ibfk_1` FOREIGN KEY (`service_id`) REFERENCES `services` (`service_id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `service_vendors_ibfk_2` FOREIGN KEY (`vendor_id`) REFERENCES `vendors` (`vendor_id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
|
|
@ -1732,19 +1732,19 @@ DROP TABLE IF EXISTS `services`;
|
|||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `services` (
|
||||
`service_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`service_name` varchar(200) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
|
||||
`service_description` varchar(200) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
|
||||
`service_category` varchar(20) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
|
||||
`service_importance` varchar(10) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
|
||||
`service_name` varchar(200) NOT NULL,
|
||||
`service_description` varchar(200) NOT NULL,
|
||||
`service_category` varchar(20) NOT NULL,
|
||||
`service_importance` varchar(10) NOT NULL,
|
||||
`service_backup` varchar(200) DEFAULT NULL,
|
||||
`service_notes` text CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL,
|
||||
`service_notes` mediumtext NOT NULL,
|
||||
`service_created_at` datetime NOT NULL DEFAULT current_timestamp(),
|
||||
`service_updated_at` datetime DEFAULT NULL ON UPDATE current_timestamp(),
|
||||
`service_accessed_at` datetime DEFAULT NULL,
|
||||
`service_review_due` date DEFAULT NULL,
|
||||
`service_client_id` int(11) NOT NULL,
|
||||
PRIMARY KEY (`service_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
|
|
@ -1922,7 +1922,7 @@ CREATE TABLE `software_assets` (
|
|||
KEY `asset_id` (`asset_id`),
|
||||
CONSTRAINT `software_assets_ibfk_1` FOREIGN KEY (`software_id`) REFERENCES `software` (`software_id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `software_assets_ibfk_2` FOREIGN KEY (`asset_id`) REFERENCES `assets` (`asset_id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
|
|
@ -1939,7 +1939,7 @@ CREATE TABLE `software_contacts` (
|
|||
KEY `contact_id` (`contact_id`),
|
||||
CONSTRAINT `software_contacts_ibfk_1` FOREIGN KEY (`software_id`) REFERENCES `software` (`software_id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `software_contacts_ibfk_2` FOREIGN KEY (`contact_id`) REFERENCES `contacts` (`contact_id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
|
|
@ -1956,7 +1956,7 @@ CREATE TABLE `software_credentials` (
|
|||
KEY `credential_id` (`credential_id`),
|
||||
CONSTRAINT `software_credentials_ibfk_1` FOREIGN KEY (`software_id`) REFERENCES `software` (`software_id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `software_credentials_ibfk_2` FOREIGN KEY (`credential_id`) REFERENCES `credentials` (`credential_id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
|
|
@ -1973,7 +1973,7 @@ CREATE TABLE `software_documents` (
|
|||
KEY `document_id` (`document_id`),
|
||||
CONSTRAINT `software_documents_ibfk_1` FOREIGN KEY (`software_id`) REFERENCES `software` (`software_id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `software_documents_ibfk_2` FOREIGN KEY (`document_id`) REFERENCES `documents` (`document_id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
|
|
@ -1990,7 +1990,7 @@ CREATE TABLE `software_files` (
|
|||
KEY `file_id` (`file_id`),
|
||||
CONSTRAINT `software_files_ibfk_1` FOREIGN KEY (`software_id`) REFERENCES `software` (`software_id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `software_files_ibfk_2` FOREIGN KEY (`file_id`) REFERENCES `files` (`file_id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
|
|
@ -2010,7 +2010,7 @@ CREATE TABLE `tags` (
|
|||
`tag_updated_at` datetime DEFAULT NULL ON UPDATE current_timestamp(),
|
||||
`tag_archived_at` datetime DEFAULT NULL,
|
||||
PRIMARY KEY (`tag_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
|
|
@ -2052,7 +2052,7 @@ CREATE TABLE `tasks` (
|
|||
`task_updated_at` datetime DEFAULT NULL ON UPDATE current_timestamp(),
|
||||
`task_ticket_id` int(11) DEFAULT NULL,
|
||||
PRIMARY KEY (`task_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
|
|
@ -2070,7 +2070,7 @@ CREATE TABLE `taxes` (
|
|||
`tax_updated_at` datetime DEFAULT NULL ON UPDATE current_timestamp(),
|
||||
`tax_archived_at` datetime DEFAULT NULL,
|
||||
PRIMARY KEY (`tax_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
|
|
@ -2105,7 +2105,7 @@ CREATE TABLE `ticket_attachments` (
|
|||
`ticket_attachment_ticket_id` int(11) NOT NULL,
|
||||
`ticket_attachment_reply_id` int(11) DEFAULT NULL,
|
||||
PRIMARY KEY (`ticket_attachment_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
|
|
@ -2212,7 +2212,7 @@ CREATE TABLE `ticket_watchers` (
|
|||
`watcher_email` varchar(255) NOT NULL,
|
||||
`watcher_ticket_id` int(11) NOT NULL,
|
||||
PRIMARY KEY (`watcher_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
|
|
@ -2369,7 +2369,7 @@ CREATE TABLE `user_settings` (
|
|||
`user_config_dashboard_technical_enable` tinyint(1) NOT NULL DEFAULT 0,
|
||||
`user_config_calendar_first_day` tinyint(1) NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (`user_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
|
|
@ -2416,7 +2416,7 @@ CREATE TABLE `vendor_credentials` (
|
|||
KEY `credential_id` (`credential_id`),
|
||||
CONSTRAINT `vendor_credentials_ibfk_1` FOREIGN KEY (`vendor_id`) REFERENCES `vendors` (`vendor_id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `vendor_credentials_ibfk_2` FOREIGN KEY (`credential_id`) REFERENCES `credentials` (`credential_id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
|
|
@ -2433,7 +2433,7 @@ CREATE TABLE `vendor_documents` (
|
|||
KEY `document_id` (`document_id`),
|
||||
CONSTRAINT `vendor_documents_ibfk_1` FOREIGN KEY (`vendor_id`) REFERENCES `vendors` (`vendor_id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `vendor_documents_ibfk_2` FOREIGN KEY (`document_id`) REFERENCES `documents` (`document_id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
|
|
@ -2450,7 +2450,7 @@ CREATE TABLE `vendor_files` (
|
|||
KEY `file_id` (`file_id`),
|
||||
CONSTRAINT `vendor_files_ibfk_1` FOREIGN KEY (`vendor_id`) REFERENCES `vendors` (`vendor_id`) ON DELETE CASCADE,
|
||||
CONSTRAINT `vendor_files_ibfk_2` FOREIGN KEY (`file_id`) REFERENCES `files` (`file_id`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
--
|
||||
|
|
@ -2494,4 +2494,4 @@ CREATE TABLE `vendors` (
|
|||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||
|
||||
-- Dump completed on 2025-03-14 18:18:06
|
||||
-- Dump completed on 2025-03-15 18:27:55
|
||||
|
|
|
|||
|
|
@ -5,4 +5,4 @@
|
|||
* It is used in conjunction with database_updates.php
|
||||
*/
|
||||
|
||||
DEFINE("LATEST_DATABASE_VERSION", "2.0.5");
|
||||
DEFINE("LATEST_DATABASE_VERSION", "2.0.6");
|
||||
|
|
|
|||
Loading…
Reference in New Issue