| 1 |
-- ----------------------------------------- |
| 2 |
-- upgrade path for Icinga 2.5.0 |
| 3 |
-- |
| 4 |
-- ----------------------------------------- |
| 5 |
-- SPDX-FileCopyrightText: 2012 Icinga GmbH <https://icinga.com> |
| 6 |
-- SPDX-License-Identifier: GPL-2.0-or-later |
| 7 |
-- |
| 8 |
-- Please check https://docs.icinga.com for upgrading information! |
| 9 |
-- ----------------------------------------- |
| 10 |
|
| 11 |
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; |
| 12 |
|
| 13 |
-- ----------------------------------------- |
| 14 |
-- #10069 IDO: check_source should not be a TEXT field |
| 15 |
-- ----------------------------------------- |
| 16 |
|
| 17 |
ALTER TABLE icinga_hoststatus MODIFY COLUMN check_source varchar(255) character set latin1 default ''; |
| 18 |
ALTER TABLE icinga_servicestatus MODIFY COLUMN check_source varchar(255) character set latin1 default ''; |
| 19 |
|
| 20 |
-- ----------------------------------------- |
| 21 |
-- #10070 |
| 22 |
-- ----------------------------------------- |
| 23 |
|
| 24 |
CREATE INDEX idx_comments_object_id on icinga_comments(object_id); |
| 25 |
CREATE INDEX idx_scheduleddowntime_object_id on icinga_scheduleddowntime(object_id); |
| 26 |
|
| 27 |
-- ----------------------------------------- |
| 28 |
-- #11962 |
| 29 |
-- ----------------------------------------- |
| 30 |
|
| 31 |
ALTER TABLE icinga_hoststatus MODIFY COLUMN current_notification_number int unsigned default 0; |
| 32 |
ALTER TABLE icinga_servicestatus MODIFY COLUMN current_notification_number int unsigned default 0; |
| 33 |
|
| 34 |
-- ----------------------------------------- |
| 35 |
-- #10061 |
| 36 |
-- ----------------------------------------- |
| 37 |
|
| 38 |
ALTER TABLE icinga_contactgroups MODIFY COLUMN alias varchar(255) character set latin1 default ''; |
| 39 |
ALTER TABLE icinga_contacts MODIFY COLUMN alias varchar(255) character set latin1 default ''; |
| 40 |
ALTER TABLE icinga_hostgroups MODIFY COLUMN alias varchar(255) character set latin1 default ''; |
| 41 |
ALTER TABLE icinga_hosts MODIFY COLUMN alias varchar(255) character set latin1 default ''; |
| 42 |
ALTER TABLE icinga_servicegroups MODIFY COLUMN alias varchar(255) character set latin1 default ''; |
| 43 |
ALTER TABLE icinga_timeperiods MODIFY COLUMN alias varchar(255) character set latin1 default ''; |
| 44 |
|
| 45 |
-- ----------------------------------------- |
| 46 |
-- #10066 |
| 47 |
-- ----------------------------------------- |
| 48 |
|
| 49 |
CREATE INDEX idx_endpoints_object_id on icinga_endpoints(endpoint_object_id); |
| 50 |
CREATE INDEX idx_endpointstatus_object_id on icinga_endpointstatus(endpoint_object_id); |
| 51 |
|
| 52 |
CREATE INDEX idx_endpoints_zone_object_id on icinga_endpoints(zone_object_id); |
| 53 |
CREATE INDEX idx_endpointstatus_zone_object_id on icinga_endpointstatus(zone_object_id); |
| 54 |
|
| 55 |
CREATE INDEX idx_zones_object_id on icinga_zones(zone_object_id); |
| 56 |
CREATE INDEX idx_zonestatus_object_id on icinga_zonestatus(zone_object_id); |
| 57 |
|
| 58 |
CREATE INDEX idx_zones_parent_object_id on icinga_zones(parent_zone_object_id); |
| 59 |
CREATE INDEX idx_zonestatus_parent_object_id on icinga_zonestatus(parent_zone_object_id); |
| 60 |
|
| 61 |
-- ----------------------------------------- |
| 62 |
-- #12107 |
| 63 |
-- ----------------------------------------- |
| 64 |
CREATE INDEX idx_statehistory_cleanup on icinga_statehistory(instance_id, state_time); |
| 65 |
|
| 66 |
-- ----------------------------------------- |
| 67 |
-- #12258 |
| 68 |
-- ----------------------------------------- |
| 69 |
ALTER TABLE icinga_comments ADD COLUMN session_token INTEGER default NULL; |
| 70 |
ALTER TABLE icinga_scheduleddowntime ADD COLUMN session_token INTEGER default NULL; |
| 71 |
|
| 72 |
CREATE INDEX idx_comments_session_del ON icinga_comments (instance_id, session_token); |
| 73 |
CREATE INDEX idx_downtimes_session_del ON icinga_scheduleddowntime (instance_id, session_token); |
| 74 |
|
| 75 |
-- ----------------------------------------- |
| 76 |
-- #12435 |
| 77 |
-- ----------------------------------------- |
| 78 |
ALTER TABLE icinga_commands ADD config_hash VARCHAR(64) DEFAULT NULL; |
| 79 |
ALTER TABLE icinga_contactgroups ADD config_hash VARCHAR(64) DEFAULT NULL; |
| 80 |
ALTER TABLE icinga_contacts ADD config_hash VARCHAR(64) DEFAULT NULL; |
| 81 |
ALTER TABLE icinga_hostgroups ADD config_hash VARCHAR(64) DEFAULT NULL; |
| 82 |
ALTER TABLE icinga_hosts ADD config_hash VARCHAR(64) DEFAULT NULL; |
| 83 |
ALTER TABLE icinga_servicegroups ADD config_hash VARCHAR(64) DEFAULT NULL; |
| 84 |
ALTER TABLE icinga_services ADD config_hash VARCHAR(64) DEFAULT NULL; |
| 85 |
ALTER TABLE icinga_timeperiods ADD config_hash VARCHAR(64) DEFAULT NULL; |
| 86 |
ALTER TABLE icinga_endpoints ADD config_hash VARCHAR(64) DEFAULT NULL; |
| 87 |
ALTER TABLE icinga_zones ADD config_hash VARCHAR(64) DEFAULT NULL; |
| 88 |
|
| 89 |
ALTER TABLE icinga_customvariables DROP session_token; |
| 90 |
ALTER TABLE icinga_customvariablestatus DROP session_token; |
| 91 |
|
| 92 |
CREATE INDEX idx_customvariables_object_id on icinga_customvariables(object_id); |
| 93 |
CREATE INDEX idx_contactgroup_members_object_id on icinga_contactgroup_members(contact_object_id); |
| 94 |
CREATE INDEX idx_hostgroup_members_object_id on icinga_hostgroup_members(host_object_id); |
| 95 |
CREATE INDEX idx_servicegroup_members_object_id on icinga_servicegroup_members(service_object_id); |
| 96 |
CREATE INDEX idx_servicedependencies_dependent_service_object_id on icinga_servicedependencies(dependent_service_object_id); |
| 97 |
CREATE INDEX idx_hostdependencies_dependent_host_object_id on icinga_hostdependencies(dependent_host_object_id); |
| 98 |
CREATE INDEX idx_service_contacts_service_id on icinga_service_contacts(service_id); |
| 99 |
CREATE INDEX idx_host_contacts_host_id on icinga_host_contacts(host_id); |
| 100 |
|
| 101 |
-- ----------------------------------------- |
| 102 |
-- set dbversion |
| 103 |
-- ----------------------------------------- |
| 104 |
INSERT INTO icinga_dbversion (name, version, create_time, modify_time) VALUES ('idoutils', '1.14.1', NOW(), NOW()) ON DUPLICATE KEY UPDATE version='1.14.1', modify_time=NOW(); |