Debian Codegraph @

lib/db_ido_mysql/schema/upgrade/2.4.0.sql

raw
1 -- -----------------------------------------
2 -- upgrade path for Icinga 2.4.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 -- -----------------------------------------
12 -- #9286 - zone tables
13 -- -----------------------------------------
14
15 ALTER TABLE icinga_endpoints ADD COLUMN zone_object_id bigint(20) unsigned DEFAULT '0';
16 ALTER TABLE icinga_endpointstatus ADD COLUMN zone_object_id bigint(20) unsigned DEFAULT '0';
17
18 CREATE TABLE IF NOT EXISTS icinga_zones (
19 zone_id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
20 instance_id bigint unsigned default 0,
21 zone_object_id bigint(20) unsigned DEFAULT '0',
22 config_type smallint(6) DEFAULT '0',
23 parent_zone_object_id bigint(20) unsigned DEFAULT '0',
24 is_global smallint(6),
25 PRIMARY KEY (zone_id)
26 ) ENGINE=InnoDB COMMENT='Zone configuration';
27
28 CREATE TABLE IF NOT EXISTS icinga_zonestatus (
29 zonestatus_id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
30 instance_id bigint unsigned default 0,
31 zone_object_id bigint(20) unsigned DEFAULT '0',
32 status_update_time timestamp NOT NULL,
33 parent_zone_object_id bigint(20) unsigned DEFAULT '0',
34 PRIMARY KEY (zonestatus_id)
35 ) ENGINE=InnoDB COMMENT='Zone status';
36
37
38 -- -----------------------------------------
39 -- #9576 - freshness_threshold
40 -- -----------------------------------------
41
42 ALTER TABLE icinga_services MODIFY freshness_threshold int;
43 ALTER TABLE icinga_hosts MODIFY freshness_threshold int;
44
45 -- -----------------------------------------
46 -- #10392 - original attributes
47 -- -----------------------------------------
48
49 ALTER TABLE icinga_servicestatus ADD COLUMN original_attributes TEXT character set latin1 default NULL;
50 ALTER TABLE icinga_hoststatus ADD COLUMN original_attributes TEXT character set latin1 default NULL;
51
52 -- -----------------------------------------
53 -- #10436 deleted custom vars
54 -- -----------------------------------------
55
56 ALTER TABLE icinga_customvariables ADD COLUMN session_token int default NULL;
57 ALTER TABLE icinga_customvariablestatus ADD COLUMN session_token int default NULL;
58
59 CREATE INDEX cv_session_del_idx ON icinga_customvariables (session_token);
60 CREATE INDEX cvs_session_del_idx ON icinga_customvariablestatus (session_token);
61
62 -- -----------------------------------------
63 -- #10431 comment/downtime name
64 -- -----------------------------------------
65
66 ALTER TABLE icinga_comments ADD COLUMN name TEXT character set latin1 default NULL;
67 ALTER TABLE icinga_commenthistory ADD COLUMN name TEXT character set latin1 default NULL;
68
69 ALTER TABLE icinga_scheduleddowntime ADD COLUMN name TEXT character set latin1 default NULL;
70 ALTER TABLE icinga_downtimehistory ADD COLUMN name TEXT character set latin1 default NULL;
71
72 -- -----------------------------------------
73 -- update dbversion
74 -- -----------------------------------------
75
76 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();