[icinga-checkins] icinga.org: icinga2/master: DB IDO: Make check_source a varchar(255) column

git at icinga.org git at icinga.org
Fri Jun 17 11:21:18 CEST 2016


Module: icinga2
Branch: master
Commit: 759818d2894a4da5859b826cd860cc60f5805a19
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=759818d2894a4da5859b826cd860cc60f5805a19

Author: Lee Clemens <java at leeclemens.net>
Date:   Mon Feb  1 19:26:55 2016 -0500

DB IDO: Make check_source a varchar(255) column

fixes #10069

Signed-off-by: Michael Friedrich <michael.friedrich at netways.de>

---

 lib/db_ido_mysql/schema/mysql.sql         |    4 ++--
 lib/db_ido_mysql/schema/upgrade/2.5.0.sql |   20 ++++++++++++++++++++
 lib/db_ido_pgsql/schema/pgsql.sql         |    6 +++---
 lib/db_ido_pgsql/schema/upgrade/2.5.0.sql |   22 ++++++++++++++++++++++
 4 files changed, 47 insertions(+), 5 deletions(-)

diff --git a/lib/db_ido_mysql/schema/mysql.sql b/lib/db_ido_mysql/schema/mysql.sql
index 01a557c..04377c7 100644
--- a/lib/db_ido_mysql/schema/mysql.sql
+++ b/lib/db_ido_mysql/schema/mysql.sql
@@ -713,7 +713,7 @@ CREATE TABLE IF NOT EXISTS icinga_hoststatus (
   output TEXT character set latin1  default '',
   long_output TEXT  default '',
   perfdata TEXT character set latin1  default '',
-  check_source TEXT character set latin1  default '',
+  check_source varchar(255) character set latin1  default '',
   current_state smallint default 0,
   has_been_checked smallint default 0,
   should_be_scheduled smallint default 0,
@@ -1200,7 +1200,7 @@ CREATE TABLE IF NOT EXISTS icinga_servicestatus (
   output TEXT character set latin1  default '',
   long_output TEXT  default '',
   perfdata TEXT character set latin1  default '',
-  check_source TEXT character set latin1  default '',
+  check_source varchar(255) character set latin1  default '',
   current_state smallint default 0,
   has_been_checked smallint default 0,
   should_be_scheduled smallint default 0,
diff --git a/lib/db_ido_mysql/schema/upgrade/2.5.0.sql b/lib/db_ido_mysql/schema/upgrade/2.5.0.sql
new file mode 100644
index 0000000..b693cf3
--- /dev/null
+++ b/lib/db_ido_mysql/schema/upgrade/2.5.0.sql
@@ -0,0 +1,20 @@
+-- -----------------------------------------
+-- upgrade path for Icinga 2.5.0
+--
+-- -----------------------------------------
+-- Copyright (c) 2016 Icinga Development Team (http://www.icinga.org)
+--
+-- Please check http://docs.icinga.org for upgrading information!
+-- -----------------------------------------
+
+-- -----------------------------------------
+-- #10069 IDO: check_source should not be a TEXT field
+-- -----------------------------------------
+
+ALTER TABLE icinga_hoststatus MODIFY COLUMN check_source varchar(255) character set latin1  default '';
+ALTER TABLE icinga_servicestatus MODIFY COLUMN check_source varchar(255) character set latin1  default '';
+
+-- -----------------------------------------
+-- set dbversion
+-- -----------------------------------------
+INSERT INTO icinga_dbversion (name, version, create_time, modify_time) VALUES ('idoutils', '1.14.1', NOW(), NOW()) ON DUPLICATE KEY UPDATE version='1.14.1', modify_time=NOW();
diff --git a/lib/db_ido_pgsql/schema/pgsql.sql b/lib/db_ido_pgsql/schema/pgsql.sql
index 4184a1a..f81a002 100644
--- a/lib/db_ido_pgsql/schema/pgsql.sql
+++ b/lib/db_ido_pgsql/schema/pgsql.sql
@@ -739,7 +739,7 @@ CREATE TABLE  icinga_hoststatus (
   output TEXT  default '',
   long_output TEXT  default '',
   perfdata TEXT  default '',
-  check_source TEXT  default '',
+  check_source varchar(255) default '',
   current_state INTEGER  default 0,
   has_been_checked INTEGER  default 0,
   should_be_scheduled INTEGER  default 0,
@@ -1226,7 +1226,7 @@ CREATE TABLE  icinga_servicestatus (
   output TEXT  default '',
   long_output TEXT  default '',
   perfdata TEXT  default '',
-  check_source TEXT  default '',
+  check_source varchar(255) default '',
   current_state INTEGER  default 0,
   has_been_checked INTEGER  default 0,
   should_be_scheduled INTEGER  default 0,
@@ -1323,7 +1323,7 @@ CREATE TABLE  icinga_statehistory (
   last_hard_state INTEGER  default '-1',
   output TEXT  default '',
   long_output TEXT  default '',
-  check_source TEXT default '',
+  check_source varchar(255) default '',
   CONSTRAINT PK_statehistory_id PRIMARY KEY (statehistory_id)
 ) ;
 
diff --git a/lib/db_ido_pgsql/schema/upgrade/2.5.0.sql b/lib/db_ido_pgsql/schema/upgrade/2.5.0.sql
new file mode 100644
index 0000000..c851f71
--- /dev/null
+++ b/lib/db_ido_pgsql/schema/upgrade/2.5.0.sql
@@ -0,0 +1,22 @@
+-- -----------------------------------------
+-- upgrade path for Icinga 2.5.0
+--
+-- -----------------------------------------
+-- Copyright (c) 2016 Icinga Development Team (http://www.icinga.org)
+--
+-- Please check http://docs.icinga.org for upgrading information!
+-- -----------------------------------------
+
+-- -----------------------------------------
+-- #10069 IDO: check_source should not be a TEXT field
+-- -----------------------------------------
+
+ALTER TABLE icinga_hoststatus ALTER COLUMN check_source TYPE varchar(255);
+ALTER TABLE icinga_servicestatus ALTER COLUMN check_source TYPE varchar(255);
+ALTER TABLE icinga_statehistory ALTER COLUMN check_source TYPE varchar(255);
+
+-- -----------------------------------------
+-- set dbversion
+-- -----------------------------------------
+
+SELECT updatedbversion('1.14.1');



More information about the icinga-checkins mailing list