[icinga-checkins] icinga.org: icinga-core/next: IDO: Import 'is_json' for custom vars into schema (Icinga 2)

git at icinga.org git at icinga.org
Tue Nov 4 13:52:53 CET 2014


Module: icinga-core
Branch: next
Commit: ec56375ea0a32eb8bce1338eda73ad3e5e3cc1b2
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=ec56375ea0a32eb8bce1338eda73ad3e5e3cc1b2

Author: Michael Friedrich <michael.friedrich at netways.de>
Date:   Tue Nov  4 13:52:25 2014 +0100

IDO: Import 'is_json' for custom vars into schema (Icinga 2)

fixes #7568

---

 Changelog                                                 |    2 ++
 module/idoutils/db/mysql/mysql.sql                        |    2 ++
 module/idoutils/db/mysql/upgrade/mysql-upgrade-1.12.0.sql |    3 +++
 module/idoutils/db/pgsql/pgsql.sql                        |    3 ++-
 module/idoutils/db/pgsql/upgrade/pgsql-upgrade-1.12.0.sql |    3 +++
 5 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/Changelog b/Changelog
index 7969a5a..5ea1591 100644
--- a/Changelog
+++ b/Changelog
@@ -39,6 +39,7 @@ ENHANCEMENTS
 
 * idoutils: Add program_version column to programstatus table #7390 - MF
 * idoutils: Extend size of column 'alias' for MySQL tables hosts & contacts #6382 - MF
+* idoutils: Import 'is_json' for custom vars into schema (Icinga 2) #7568 - MF
 
 FIXES
 
@@ -57,6 +58,7 @@ CHANGES
 * idoutils: Add program_version column to programstatus table #7390
 	** required for Icinga Web 2 and Icinga 2
 * idoutils: 'alias' column is now TEXT in MySQL #6382
+* idoutils: Import 'is_json' for custom vars into schema (Icinga 2) #7568
 
 
 1.11.7 - 03/09/2014
diff --git a/module/idoutils/db/mysql/mysql.sql b/module/idoutils/db/mysql/mysql.sql
index 52ba373..9cbaed2 100644
--- a/module/idoutils/db/mysql/mysql.sql
+++ b/module/idoutils/db/mysql/mysql.sql
@@ -339,6 +339,7 @@ CREATE TABLE IF NOT EXISTS icinga_customvariables (
   has_been_modified smallint default 0,
   varname varchar(255) character set latin1 collate latin1_general_cs default NULL,
   varvalue TEXT character set latin1  default '',
+  is_json smallint default 0,
   PRIMARY KEY  (customvariable_id),
   UNIQUE KEY object_id_2 (object_id,config_type,varname),
   KEY varname (varname)
@@ -358,6 +359,7 @@ CREATE TABLE IF NOT EXISTS icinga_customvariablestatus (
   has_been_modified smallint default 0,
   varname varchar(255) character set latin1 collate latin1_general_cs default NULL,
   varvalue TEXT character set latin1  default '',
+  is_json smallint default 0,
   PRIMARY KEY  (customvariablestatus_id),
   UNIQUE KEY object_id_2 (object_id,varname),
   KEY varname (varname)
diff --git a/module/idoutils/db/mysql/upgrade/mysql-upgrade-1.12.0.sql b/module/idoutils/db/mysql/upgrade/mysql-upgrade-1.12.0.sql
index 696a1fa..bb737d8 100644
--- a/module/idoutils/db/mysql/upgrade/mysql-upgrade-1.12.0.sql
+++ b/module/idoutils/db/mysql/upgrade/mysql-upgrade-1.12.0.sql
@@ -12,6 +12,9 @@ ALTER TABLE `icinga_programstatus` ADD COLUMN `program_version` varchar(64) char
 ALTER TABLE icinga_contacts MODIFY alias TEXT character set latin1  default '';
 ALTER TABLE icinga_hosts MODIFY alias TEXT character set latin1  default '';
 
+ALTER TABLE icinga_customvariables ADD COLUMN is_json smallint default 0;
+ALTER TABLE icinga_customvariablestatus ADD COLUMN is_json smallint default 0;
+
 -- -----------------------------------------
 -- update dbversion
 -- -----------------------------------------
diff --git a/module/idoutils/db/pgsql/pgsql.sql b/module/idoutils/db/pgsql/pgsql.sql
index ade99b6..6ce0446 100644
--- a/module/idoutils/db/pgsql/pgsql.sql
+++ b/module/idoutils/db/pgsql/pgsql.sql
@@ -365,6 +365,7 @@ CREATE TABLE  icinga_customvariables (
   has_been_modified INTEGER  default 0,
   varname TEXT  default '',
   varvalue TEXT  default '',
+  is_json INTEGER  default 0,
   CONSTRAINT PK_customvariable_id PRIMARY KEY (customvariable_id) ,
   CONSTRAINT UQ_customvariables UNIQUE (object_id,config_type,varname)
 ) ;
@@ -384,6 +385,7 @@ CREATE TABLE  icinga_customvariablestatus (
   has_been_modified INTEGER  default 0,
   varname TEXT  default '',
   varvalue TEXT  default '',
+  is_json INTEGER  default 0,
   CONSTRAINT PK_customvariablestatus_id PRIMARY KEY (customvariablestatus_id) ,
   CONSTRAINT UQ_customvariablestatus UNIQUE (object_id,varname)
 ) ;
@@ -1436,7 +1438,6 @@ ALTER TABLE icinga_servicechecks ADD COLUMN endpoint_object_id bigint default NU
 ALTER TABLE icinga_statehistory ADD COLUMN endpoint_object_id bigint default NULL;
 ALTER TABLE icinga_systemcommands ADD COLUMN endpoint_object_id bigint default NULL;
 
-ALTER TABLE icinga_hosts ADD COLUMN check_service_object_id bigint default NULL;
 
 -- -----------------------------------------
 -- add index (delete)
diff --git a/module/idoutils/db/pgsql/upgrade/pgsql-upgrade-1.12.0.sql b/module/idoutils/db/pgsql/upgrade/pgsql-upgrade-1.12.0.sql
index 8456f6b..621eea8 100644
--- a/module/idoutils/db/pgsql/upgrade/pgsql-upgrade-1.12.0.sql
+++ b/module/idoutils/db/pgsql/upgrade/pgsql-upgrade-1.12.0.sql
@@ -9,6 +9,9 @@
 
 ALTER TABLE icinga_programstatus ADD COLUMN program_version TEXT default NULL;
 
+ALTER TABLE icinga_customvariables ADD COLUMN is_json INTEGER default 0;
+ALTER TABLE icinga_customvariablestatus ADD COLUMN is_json INTEGER default 0;
+
 -- -----------------------------------------
 -- update dbversion
 -- -----------------------------------------



More information about the icinga-checkins mailing list