This repository has been archived by the owner on Jan 15, 2019. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixes #9047 fixes #9832
- Loading branch information
Michael Friedrich
committed
Oct 30, 2015
1 parent
028eca6
commit a3b767a
Showing
9 changed files
with
512 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
-- ----------------------------------------- | ||
-- upgrade path for Icinga 2.4.0 | ||
-- | ||
-- ----------------------------------------- | ||
-- Copyright (c) 2015 Icinga Development Team (http://www.icinga.org) | ||
-- | ||
-- Please check http://docs.icinga.org for upgrading information! | ||
-- ----------------------------------------- | ||
|
||
-- ----------------------------------------- | ||
-- #9286 - zone tables | ||
-- ----------------------------------------- | ||
|
||
ALTER TABLE icinga_endpoints ADD COLUMN zone_object_id bigint(20) unsigned DEFAULT '0'; | ||
ALTER TABLE icinga_endpointstatus ADD COLUMN zone_object_id bigint(20) unsigned DEFAULT '0'; | ||
|
||
CREATE TABLE IF NOT EXISTS icinga_zones ( | ||
zone_id bigint(20) unsigned NOT NULL AUTO_INCREMENT, | ||
instance_id bigint unsigned default 0, | ||
zone_object_id bigint(20) unsigned DEFAULT '0', | ||
config_type smallint(6) DEFAULT '0', | ||
parent_zone_object_id bigint(20) unsigned DEFAULT '0', | ||
is_global smallint(6), | ||
PRIMARY KEY (zone_id) | ||
) ENGINE=InnoDB COMMENT='Zone configuration'; | ||
|
||
CREATE TABLE IF NOT EXISTS icinga_zonestatus ( | ||
zonestatus_id bigint(20) unsigned NOT NULL AUTO_INCREMENT, | ||
instance_id bigint unsigned default 0, | ||
zone_object_id bigint(20) unsigned DEFAULT '0', | ||
status_update_time timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', | ||
parent_zone_object_id bigint(20) unsigned DEFAULT '0', | ||
PRIMARY KEY (zonestatus_id) | ||
) ENGINE=InnoDB COMMENT='Zone status'; | ||
|
||
|
||
-- ----------------------------------------- | ||
-- #9576 - freshness_threshold | ||
-- ----------------------------------------- | ||
|
||
ALTER TABLE icinga_services MODIFY freshness_threshold int; | ||
ALTER TABLE icinga_hosts MODIFY freshness_threshold int; | ||
|
||
-- ----------------------------------------- | ||
-- #10392 - original attributes | ||
-- ----------------------------------------- | ||
|
||
ALTER TABLE icinga_servicestatus ADD COLUMN original_attributes TEXT character set latin1 default NULL; | ||
ALTER TABLE icinga_hoststatus ADD COLUMN original_attributes TEXT character set latin1 default NULL; | ||
|
||
-- ----------------------------------------- | ||
-- #10436 deleted custom vars | ||
-- ----------------------------------------- | ||
|
||
ALTER TABLE icinga_customvariables ADD COLUMN session_token varchar(512) character set latin1 default NULL; | ||
ALTER TABLE icinga_customvariablestatus ADD COLUMN session_token varchar(512) character set latin1 default NULL; | ||
|
||
CREATE INDEX cv_session_del_idx ON icinga_customvariables (session_token); | ||
CREATE INDEX cvs_session_del_idx ON icinga_customvariablestatus (session_token); | ||
|
||
-- ----------------------------------------- | ||
-- #10431 comment/downtime unique id | ||
-- ----------------------------------------- | ||
|
||
ALTER TABLE icinga_comments ADD COLUMN unique_id TEXT character set latin1 default NULL; | ||
ALTER TABLE icinga_commenthistory ADD COLUMN unique_id TEXT character set latin1 default NULL; | ||
|
||
ALTER TABLE icinga_scheduleddowntime ADD COLUMN unique_id TEXT character set latin1 default NULL; | ||
ALTER TABLE icinga_downtimehistory ADD COLUMN unique_id TEXT character set latin1 default NULL; | ||
|
||
-- ----------------------------------------- | ||
-- update dbversion | ||
-- ----------------------------------------- | ||
|
||
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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
module/idoutils/db/oracle/upgrade/oracle-upgrade-1.14.0.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
-- ----------------------------------------- | ||
-- upgrade path for Icinga IDOUtils 1.14.0 | ||
-- | ||
-- run it as icinga database user from whithin current directory | ||
-- sqlplus icinga@<instance> @ oracle-upgrade-1.14.0.sql | ||
|
||
-- ----------------------------------------- | ||
-- Copyright (c) 2014 Icinga Development Team (http://www.icinga.org) | ||
-- | ||
-- Please check http://docs.icinga.org for upgrading information! | ||
-- ----------------------------------------- | ||
set sqlprompt "&&_USER@&&_CONNECT_IDENTIFIER SQL>" | ||
set pagesize 200; | ||
set linesize 200; | ||
set heading on; | ||
set echo on; | ||
set feedback on; | ||
|
||
define ICINGA_VERSION=1.14.0 | ||
|
||
-- -------------------------------------------------------- | ||
-- warning: edit this script to define existing tablespaces | ||
-- this particular step can be skipped safely if no new | ||
-- table or index included | ||
-- -------------------------------------------------------- | ||
/* set real TBS names on which you have quota, no checks are implemented!*/ | ||
define DATATBS='ICINGA_DATA1'; | ||
define LOBTBS='ICINGA_LOB1'; | ||
define IDXTBS='ICINGA_IDX1'; | ||
|
||
/* load defines from file, if any */ | ||
@icinga_defines.sql | ||
|
||
/* script will be terminated on the first error */ | ||
whenever sqlerror exit failure | ||
spool oracle-upgrade-&&ICINGA_VERSION..log | ||
|
||
|
||
-- ----------------------------------------- | ||
-- finally update dbversion | ||
-- ----------------------------------------- | ||
|
||
MERGE INTO dbversion | ||
USING DUAL ON (name='idoutils') | ||
WHEN MATCHED THEN | ||
UPDATE SET version='&&ICINGA_VERSION', modify_time=CURRENT_TIMESTAMP | ||
WHEN NOT MATCHED THEN | ||
INSERT (id, name, version, create_time, modify_time) VALUES ('1', 'idoutils', '&&ICINGA_VERSION', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP); | ||
commit; | ||
|
||
/* last check */ | ||
select object_name,object_type,status from user_objects where status !='VALID'; | ||
|
||
/* goodbye */ | ||
spool off | ||
exit; | ||
|
Oops, something went wrong.