]> granicus.if.org Git - icinga2/commitdiff
DB IDO: Add check_source to statehistory table.
authorMichael Friedrich <michael.friedrich@netways.de>
Thu, 6 Feb 2014 15:01:03 +0000 (16:01 +0100)
committerMichael Friedrich <michael.friedrich@netways.de>
Thu, 6 Feb 2014 15:01:03 +0000 (16:01 +0100)
Refs #5470

components/db_ido_mysql/schema/mysql.sql
components/db_ido_pgsql/schema/pgsql.sql
lib/db_ido/servicedbobject.cpp

index 14040cbecbeb27e2fdf81bae8254e835e6ae2d14..97012fa7bc11dec6e5fbd1176e8c6bf617d12bd6 100644 (file)
@@ -1277,6 +1277,7 @@ CREATE TABLE IF NOT EXISTS icinga_statehistory (
   last_hard_state smallint default 0,
   output TEXT character set latin1  default '',
   long_output TEXT  default '',
+  check_source varchar(255) character set latin1 default NULL,
   PRIMARY KEY  (statehistory_id)
 ) ENGINE=InnoDB COMMENT='Historical host and service state changes';
 
@@ -1524,6 +1525,9 @@ CREATE INDEX sla_idx_sthist ON icinga_statehistory (object_id, state_time DESC);
 CREATE INDEX sla_idx_dohist ON icinga_downtimehistory (object_id, actual_start_time, actual_end_time);
 CREATE INDEX sla_idx_obj ON icinga_objects (objecttype_id, is_active, name1);
 
+-- #4985
+CREATE INDEX commenthistory_delete_idx ON icinga_commenthistory (instance_id, comment_time, internal_comment_id);
+
 -- -----------------------------------------
 -- set dbversion
 -- -----------------------------------------
index 1c14cd53ea6d2ba2ddf4bf0844ccb2c73f5afb08..f7e7e94fdded55153dba4dc364a469414205d51f 100644 (file)
@@ -1303,6 +1303,7 @@ CREATE TABLE  icinga_statehistory (
   last_hard_state INTEGER  default '-1',
   output TEXT  default '',
   long_output TEXT  default '',
+  check_source varchar(255) default NULL,
   CONSTRAINT PK_statehistory_id PRIMARY KEY (statehistory_id) 
 ) ;
 
@@ -1550,6 +1551,8 @@ CREATE INDEX sla_idx_sthist ON icinga_statehistory (object_id, state_time DESC);
 CREATE INDEX sla_idx_dohist ON icinga_downtimehistory (object_id, actual_start_time, actual_end_time);
 CREATE INDEX sla_idx_obj ON icinga_objects (objecttype_id, is_active, name1);
 
+-- #4985
+CREATE INDEX commenthistory_delete_idx ON icinga_commenthistory (instance_id, comment_time, internal_comment_id);
 
 -- -----------------------------------------
 -- set dbversion
index 72d144273c7af28722e65d074e7a91c1a514e149..6b7dff5c2a0467ad69284dd29f3c015180050027 100644 (file)
@@ -861,6 +861,7 @@ void ServiceDbObject::AddStateChangeHistory(const Service::Ptr& service, const C
        if (cr) {
                fields1->Set("output", CompatUtility::GetCheckResultOutput(cr));
                fields1->Set("long_output", CompatUtility::GetCheckResultLongOutput(cr));
+               fields1->Set("check_source", cr->GetCheckSource());
        }
 
        fields1->Set("instance_id", 0); /* DbConnection class fills in real ID */