[icinga-checkins] icinga.org: icinga-core/master: Revert "Update IDO schema"

git at icinga.org git at icinga.org
Thu Dec 22 21:38:54 CET 2016


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

Author: Michael Friedrich <michael.friedrich at icinga.com>
Date:   Thu Dec 22 20:24:52 2016 +0000

Revert "Update IDO schema"

This reverts commit fed2ba5b9a2087235efbb72636279b3e9e214668.

refs #9832

---

 module/idoutils/db/mysql/mysql.sql                       |   12 ++++++------
 .../idoutils/db/mysql/upgrade/mysql-upgrade-1.14.0.sql   |   14 +++++++-------
 module/idoutils/db/pgsql/pgsql.sql                       |   12 ++++++------
 .../idoutils/db/pgsql/upgrade/pgsql-upgrade-1.14.0.sql   |   14 +++++++-------
 4 files changed, 26 insertions(+), 26 deletions(-)

diff --git a/module/idoutils/db/mysql/mysql.sql b/module/idoutils/db/mysql/mysql.sql
index 1e5a4e0..ea004ed 100644
--- a/module/idoutils/db/mysql/mysql.sql
+++ b/module/idoutils/db/mysql/mysql.sql
@@ -82,7 +82,7 @@ CREATE TABLE IF NOT EXISTS icinga_commenthistory (
   expiration_time timestamp  default '0000-00-00 00:00:00',
   deletion_time timestamp  default '0000-00-00 00:00:00',
   deletion_time_usec  int default 0,
-  name TEXT character set latin1 default NULL,
+  unique_id TEXT character set latin1 default NULL,
   PRIMARY KEY  (commenthistory_id),
   UNIQUE KEY instance_id (instance_id,object_id,comment_time,internal_comment_id)
 ) ENGINE=InnoDB  COMMENT='Historical host and service comments';
@@ -109,7 +109,7 @@ CREATE TABLE IF NOT EXISTS icinga_comments (
   comment_source smallint default 0,
   expires smallint default 0,
   expiration_time timestamp  default '0000-00-00 00:00:00',
-  name TEXT character set latin1 default NULL,
+  unique_id TEXT character set latin1 default NULL,
   PRIMARY KEY  (comment_id),
   UNIQUE KEY instance_id (instance_id,object_id,comment_time,internal_comment_id)
 ) ENGINE=InnoDB  COMMENT='Usercomments on Icinga objects';
@@ -342,7 +342,7 @@ CREATE TABLE IF NOT EXISTS icinga_customvariables (
   varname varchar(255) character set latin1 collate latin1_general_cs default NULL,
   varvalue TEXT character set latin1  default '',
   is_json smallint default 0,
-  session_token int default NULL,
+  session_token varchar(512) character set latin1 default NULL,
   PRIMARY KEY  (customvariable_id),
   UNIQUE KEY object_id_2 (object_id,config_type,varname),
   KEY varname (varname)
@@ -363,7 +363,7 @@ CREATE TABLE IF NOT EXISTS icinga_customvariablestatus (
   varname varchar(255) character set latin1 collate latin1_general_cs default NULL,
   varvalue TEXT character set latin1  default '',
   is_json smallint default 0,
-  session_token int default NULL,
+  session_token varchar(512) character set latin1 default NULL,
   PRIMARY KEY  (customvariablestatus_id),
   UNIQUE KEY object_id_2 (object_id,varname),
   KEY varname (varname)
@@ -413,7 +413,7 @@ CREATE TABLE IF NOT EXISTS icinga_downtimehistory (
   was_cancelled smallint default 0,
   is_in_effect smallint default 0,
   trigger_time timestamp  default '0000-00-00 00:00:00',
-  name TEXT character set latin1 default NULL,
+  unique_id TEXT character set latin1 default NULL,
   PRIMARY KEY  (downtimehistory_id),
   UNIQUE KEY instance_id (instance_id,object_id,entry_time,internal_downtime_id)
 ) ENGINE=InnoDB  COMMENT='Historical scheduled host and service downtime';
@@ -975,7 +975,7 @@ CREATE TABLE IF NOT EXISTS icinga_scheduleddowntime (
   actual_start_time_usec  int default 0,
   is_in_effect smallint default 0,
   trigger_time timestamp  default '0000-00-00 00:00:00',
-  name TEXT character set latin1 default NULL,
+  unique_id TEXT character set latin1 default NULL,
   PRIMARY KEY  (scheduleddowntime_id),
   UNIQUE KEY instance_id (instance_id,object_id,entry_time,internal_downtime_id)
 ) ENGINE=InnoDB COMMENT='Current scheduled host and service downtime';
diff --git a/module/idoutils/db/mysql/upgrade/mysql-upgrade-1.14.0.sql b/module/idoutils/db/mysql/upgrade/mysql-upgrade-1.14.0.sql
index 5eadc33..a7bf0fc 100644
--- a/module/idoutils/db/mysql/upgrade/mysql-upgrade-1.14.0.sql
+++ b/module/idoutils/db/mysql/upgrade/mysql-upgrade-1.14.0.sql
@@ -52,21 +52,21 @@ ALTER TABLE icinga_hoststatus ADD COLUMN original_attributes TEXT character set
 -- #10436 deleted custom vars
 -- -----------------------------------------
 
-ALTER TABLE icinga_customvariables ADD COLUMN session_token int default NULL;
-ALTER TABLE icinga_customvariablestatus ADD COLUMN session_token int default NULL;
+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 name
+-- #10431 comment/downtime unique id
 -- -----------------------------------------
 
-ALTER TABLE icinga_comments ADD COLUMN name TEXT character set latin1 default NULL;
-ALTER TABLE icinga_commenthistory ADD COLUMN name TEXT character set latin1 default NULL;
+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 name TEXT character set latin1 default NULL;
-ALTER TABLE icinga_downtimehistory ADD COLUMN name 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
diff --git a/module/idoutils/db/pgsql/pgsql.sql b/module/idoutils/db/pgsql/pgsql.sql
index fa22e10..8b9a8ce 100644
--- a/module/idoutils/db/pgsql/pgsql.sql
+++ b/module/idoutils/db/pgsql/pgsql.sql
@@ -108,7 +108,7 @@ CREATE TABLE  icinga_commenthistory (
   expiration_time timestamp with time zone default '1970-01-01 00:00:00+00',
   deletion_time timestamp with time zone default '1970-01-01 00:00:00+00',
   deletion_time_usec INTEGER  default 0,
-  name TEXT default NULL,
+  unique_id TEXT default NULL,
   CONSTRAINT PK_commenthistory_id PRIMARY KEY (commenthistory_id) ,
   CONSTRAINT UQ_commenthistory UNIQUE (instance_id,object_id,comment_time,internal_comment_id)
 );
@@ -135,7 +135,7 @@ CREATE TABLE  icinga_comments (
   comment_source INTEGER  default 0,
   expires INTEGER  default 0,
   expiration_time timestamp with time zone default '1970-01-01 00:00:00+00',
-  name TEXT default NULL,
+  unique_id TEXT default NULL,
   CONSTRAINT PK_comment_id PRIMARY KEY (comment_id) ,
   CONSTRAINT UQ_comments UNIQUE (instance_id,object_id,comment_time,internal_comment_id)
 )  ;
@@ -368,7 +368,7 @@ CREATE TABLE  icinga_customvariables (
   varname TEXT  default '',
   varvalue TEXT  default '',
   is_json INTEGER  default 0,
-  session_token INTEGER default NULL,
+  session_token TEXT default NULL,
   CONSTRAINT PK_customvariable_id PRIMARY KEY (customvariable_id) ,
   CONSTRAINT UQ_customvariables UNIQUE (object_id,config_type,varname)
 ) ;
@@ -389,7 +389,7 @@ CREATE TABLE  icinga_customvariablestatus (
   varname TEXT  default '',
   varvalue TEXT  default '',
   is_json INTEGER  default 0,
-  session_token INTEGER default NULL,
+  session_token TEXT default NULL,
   CONSTRAINT PK_customvariablestatus_id PRIMARY KEY (customvariablestatus_id) ,
   CONSTRAINT UQ_customvariablestatus UNIQUE (object_id,varname)
 ) ;
@@ -440,7 +440,7 @@ CREATE TABLE  icinga_downtimehistory (
   was_cancelled INTEGER  default 0,
   is_in_effect INTEGER  default 0,
   trigger_time timestamp with time zone default '1970-01-01 00:00:00+00',
-  name TEXT default NULL,
+  unique_id TEXT default NULL,
   CONSTRAINT PK_downtimehistory_id PRIMARY KEY (downtimehistory_id) ,
   CONSTRAINT UQ_downtimehistory UNIQUE (instance_id,object_id,entry_time,internal_downtime_id)
 ) ;
@@ -1002,7 +1002,7 @@ CREATE TABLE  icinga_scheduleddowntime (
   actual_start_time_usec INTEGER  default 0,
   is_in_effect INTEGER  default 0,
   trigger_time timestamp with time zone default '1970-01-01 00:00:00+00',
-  name TEXT default NULL,
+  unique_id TEXT default NULL,
   CONSTRAINT PK_scheduleddowntime_id PRIMARY KEY (scheduleddowntime_id) ,
   CONSTRAINT UQ_scheduleddowntime UNIQUE (instance_id,object_id,entry_time,internal_downtime_id)
 ) ;
diff --git a/module/idoutils/db/pgsql/upgrade/pgsql-upgrade-1.14.0.sql b/module/idoutils/db/pgsql/upgrade/pgsql-upgrade-1.14.0.sql
index f97954f..909869a 100644
--- a/module/idoutils/db/pgsql/upgrade/pgsql-upgrade-1.14.0.sql
+++ b/module/idoutils/db/pgsql/upgrade/pgsql-upgrade-1.14.0.sql
@@ -162,21 +162,21 @@ ALTER TABLE icinga_hoststatus ADD COLUMN  original_attributes TEXT default NULL;
 -- #10436 deleted custom vars
 -- -----------------------------------------
 
-ALTER TABLE icinga_customvariables ADD COLUMN session_token INTEGER default NULL;
-ALTER TABLE icinga_customvariablestatus ADD COLUMN session_token INTEGER default NULL;
+ALTER TABLE icinga_customvariables ADD COLUMN session_token TEXT default NULL;
+ALTER TABLE icinga_customvariablestatus ADD COLUMN session_token TEXT 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 name
+-- #10431 comment/downtime unique id
 -- -----------------------------------------
 
-ALTER TABLE icinga_comments ADD COLUMN name TEXT default NULL;
-ALTER TABLE icinga_commenthistory ADD COLUMN name TEXT default NULL;
+ALTER TABLE icinga_comments ADD COLUMN unique_id TEXT default NULL;
+ALTER TABLE icinga_commenthistory ADD COLUMN unique_id TEXT default NULL;
 
-ALTER TABLE icinga_scheduleddowntime ADD COLUMN name TEXT default NULL;
-ALTER TABLE icinga_downtimehistory ADD COLUMN name TEXT default NULL;
+ALTER TABLE icinga_scheduleddowntime ADD COLUMN unique_id TEXT default NULL;
+ALTER TABLE icinga_downtimehistory ADD COLUMN unique_id TEXT default NULL;
 
 -- -----------------------------------------
 -- update dbversion



More information about the icinga-checkins mailing list