[icinga-checkins] icinga.org: icinga-core/test/core: fix forgotten unique constraint drop for table configfilevariables #1100

git at icinga.org git at icinga.org
Sat Aug 6 21:54:49 CEST 2011


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

Author: Michael Friedrich <michael.friedrich at univie.ac.at>
Date:   Wed Aug  3 12:46:36 2011 +0200

fix forgotten unique constraint drop for table configfilevariables #1100

variables can be listed twice in the table, such as in the cfgs.

---

 .../db/oracle/create_icinga_objects_oracle.sql     |    2 --
 .../db/oracle/upgrade/oracle-upgrade-1.5.0.sql     |    1 +
 module/idoutils/db/pgsql/pgsql.sql                 |    2 --
 3 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/module/idoutils/db/oracle/create_icinga_objects_oracle.sql b/module/idoutils/db/oracle/create_icinga_objects_oracle.sql
index 332d9b2..d33064d 100644
--- a/module/idoutils/db/oracle/create_icinga_objects_oracle.sql
+++ b/module/idoutils/db/oracle/create_icinga_objects_oracle.sql
@@ -365,8 +365,6 @@ CREATE TABLE configfilevariables (
 
 alter table configfilevariables add constraint configfilevar_pk PRIMARY KEY  (id)
 	using index tablespace &&IDXTBS;
-alter table configfilevariables add constraint configfilevar_uq  UNIQUE (instance_id,configfile_id,varname)
-	using index tablespace &&IDXTBS;
 
 -- --------------------------------------------------------
 
diff --git a/module/idoutils/db/oracle/upgrade/oracle-upgrade-1.5.0.sql b/module/idoutils/db/oracle/upgrade/oracle-upgrade-1.5.0.sql
index 2796488..596bd7c 100644
--- a/module/idoutils/db/oracle/upgrade/oracle-upgrade-1.5.0.sql
+++ b/module/idoutils/db/oracle/upgrade/oracle-upgrade-1.5.0.sql
@@ -80,6 +80,7 @@ alter table eventhandlers add (long_output clob) lob (long_output) store as even
 -- drop unique keys for multiline inserts
 -- -----------------------------------------
 
+ALTER TABLE configfilevariables DROP CONSTRAINT configfilevar_uq;
 ALTER TABLE timeperiod_timeranges DROP CONSTRAINT timeperiod_timeranges_uq;
 ALTER TABLE host_parenthosts DROP CONSTRAINT host_parenthosts_uq;
 ALTER TABLE host_contactgroups DROP CONSTRAINT host_contactgroups_uq;
diff --git a/module/idoutils/db/pgsql/pgsql.sql b/module/idoutils/db/pgsql/pgsql.sql
index 7b70736..dbd5031 100644
--- a/module/idoutils/db/pgsql/pgsql.sql
+++ b/module/idoutils/db/pgsql/pgsql.sql
@@ -168,8 +168,6 @@ CREATE TABLE  icinga_configfilevariables (
   varname TEXT  default '',
   varvalue TEXT  default '',
   CONSTRAINT PK_configfilevariable_id PRIMARY KEY (configfilevariable_id) 
-  --UNIQUE (instance_id,configfile_id) 
-  -- varname/varvalue are not unique!
 ) ;
 
 -- --------------------------------------------------------





More information about the icinga-checkins mailing list