1 -- -----------------------------------------
2 -- upgrade path for Icinga 2.4.0
4 -- -----------------------------------------
5 -- Copyright (c) 2015 Icinga Development Team (https://www.icinga.com)
7 -- Please check http://docs.icinga.com for upgrading information!
8 -- -----------------------------------------
10 -- -----------------------------------------
11 -- #9286 - zone tables
12 -- -----------------------------------------
14 ALTER TABLE icinga_endpoints ADD COLUMN zone_object_id bigint(20) unsigned DEFAULT '0';
15 ALTER TABLE icinga_endpointstatus ADD COLUMN zone_object_id bigint(20) unsigned DEFAULT '0';
17 CREATE TABLE IF NOT EXISTS icinga_zones (
18 zone_id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
19 instance_id bigint unsigned default 0,
20 zone_object_id bigint(20) unsigned DEFAULT '0',
21 config_type smallint(6) DEFAULT '0',
22 parent_zone_object_id bigint(20) unsigned DEFAULT '0',
23 is_global smallint(6),
25 ) ENGINE=InnoDB COMMENT='Zone configuration';
27 CREATE TABLE IF NOT EXISTS icinga_zonestatus (
28 zonestatus_id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
29 instance_id bigint unsigned default 0,
30 zone_object_id bigint(20) unsigned DEFAULT '0',
31 status_update_time timestamp NOT NULL,
32 parent_zone_object_id bigint(20) unsigned DEFAULT '0',
33 PRIMARY KEY (zonestatus_id)
34 ) ENGINE=InnoDB COMMENT='Zone status';
37 -- -----------------------------------------
38 -- #9576 - freshness_threshold
39 -- -----------------------------------------
41 ALTER TABLE icinga_services MODIFY freshness_threshold int;
42 ALTER TABLE icinga_hosts MODIFY freshness_threshold int;
44 -- -----------------------------------------
45 -- #10392 - original attributes
46 -- -----------------------------------------
48 ALTER TABLE icinga_servicestatus ADD COLUMN original_attributes TEXT character set latin1 default NULL;
49 ALTER TABLE icinga_hoststatus ADD COLUMN original_attributes TEXT character set latin1 default NULL;
51 -- -----------------------------------------
52 -- #10436 deleted custom vars
53 -- -----------------------------------------
55 ALTER TABLE icinga_customvariables ADD COLUMN session_token int default NULL;
56 ALTER TABLE icinga_customvariablestatus ADD COLUMN session_token int default NULL;
58 CREATE INDEX cv_session_del_idx ON icinga_customvariables (session_token);
59 CREATE INDEX cvs_session_del_idx ON icinga_customvariablestatus (session_token);
61 -- -----------------------------------------
62 -- #10431 comment/downtime name
63 -- -----------------------------------------
65 ALTER TABLE icinga_comments ADD COLUMN name TEXT character set latin1 default NULL;
66 ALTER TABLE icinga_commenthistory ADD COLUMN name TEXT character set latin1 default NULL;
68 ALTER TABLE icinga_scheduleddowntime ADD COLUMN name TEXT character set latin1 default NULL;
69 ALTER TABLE icinga_downtimehistory ADD COLUMN name TEXT character set latin1 default NULL;
71 -- -----------------------------------------
73 -- -----------------------------------------
75 INSERT INTO icinga_dbversion (name, version, create_time, modify_time) VALUES ('idoutils', '1.14.0', NOW(), NOW()) ON DUPLICATE KEY UPDATE version='1.14.0', modify_time=NOW();