[icinga-checkins] icinga.org: icinga-core/next: correct pgsql index drop (thx formorer)

git at icinga.org git at icinga.org
Mon Nov 4 22:49:33 CET 2013


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

Author: Michael Friedrich <michael.friedrich at netways.de>
Date:   Tue Oct 29 23:03:51 2013 +0100

correct pgsql index drop (thx formorer)

refs #4953

---

 .../db/pgsql/upgrade/pgsql-upgrade-1.10.0.sql      |   32 ++++++++++----------
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/module/idoutils/db/pgsql/upgrade/pgsql-upgrade-1.10.0.sql b/module/idoutils/db/pgsql/upgrade/pgsql-upgrade-1.10.0.sql
index 6678a25..afc0dc1 100644
--- a/module/idoutils/db/pgsql/upgrade/pgsql-upgrade-1.10.0.sql
+++ b/module/idoutils/db/pgsql/upgrade/pgsql-upgrade-1.10.0.sql
@@ -29,29 +29,29 @@ ALTER TABLE icinga_scheduleddowntime ALTER COLUMN duration TYPE BIGINT;
 -- -----------------------------------------
 
 -- drop index too, if seperate tbs
-ALTER TABLE icinga_timedevents DROP INDEX timedevents_i_id_idx;
-ALTER TABLE icinga_timedevents DROP INDEX timedevents_time_id_idx;
-ALTER TABLE icinga_timedevents DROP INDEX timed_e_event_type_idx;
-ALTER TABLE icinga_timedevents DROP INDEX timed_e_object_id_idx;
-ALTER TABLE icinga_timedevents DROP INDEX timed_e_rec_ev_idx;
+DROP INDEX IF EXISTS timedevents_i_id_idx;
+DROP INDEX IF EXISTS timedevents_time_id_idx;
+DROP INDEX IF EXISTS timed_e_event_type_idx;
+DROP INDEX IF EXISTS timed_e_object_id_idx;
+DROP INDEX IF EXISTS timed_e_rec_ev_idx;
 
-ALTER TABLE icinga_timedeventqueue DROP INDEX timedeventq_i_id_idx;
-ALTER TABLE icinga_timedeventqueue DROP INDEX timedeventq_time_id_idx;
-ALTER TABLE icinga_timedeventqueue DROP INDEX timedeventqueue_i_id_idx;
-ALTER TABLE icinga_timedeventqueue DROP INDEX timed_e_q_event_type_idx;
-ALTER TABLE icinga_timedeventqueue DROP INDEX timed_e_q_sched_time_idx;
-ALTER TABLE icinga_timedeventqueue DROP INDEX timed_e_q_object_id_idx;
-ALTER TABLE icinga_timedeventqueue DROP INDEX timed_e_q_rec_ev_id_idx;
+DROP INDEX IF EXISTS timedeventq_i_id_idx;
+DROP INDEX IF EXISTS timedeventq_time_id_idx;
+DROP INDEX IF EXISTS timedeventqueue_i_id_idx;
+DROP INDEX IF EXISTS timed_e_q_event_type_idx;
+DROP INDEX IF EXISTS timed_e_q_sched_time_idx;
+DROP INDEX IF EXISTS timed_e_q_object_id_idx;
+DROP INDEX IF EXISTS timed_e_q_rec_ev_id_idx;
 
-DROP TABLE icinga_timedevents;
-DROP TABLE icinga_timedeventqueue;
+DROP TABLE IF EXISTS icinga_timedevents;
+DROP TABLE IF EXISTS icinga_timedeventqueue;
 
 -- -----------------------------------------
 -- #4544 icinga_comments table UK
 -- -----------------------------------------
 
-ALTER TABLE icinga_comments DROP CONSTRAINT uq_comments;
-ALTER TABLE icinga_commenthistory DROP CONSTRAINT uq_commenthistory;
+ALTER TABLE icinga_comments DROP CONSTRAINT IF EXISTS uq_comments;
+ALTER TABLE icinga_commenthistory DROP CONSTRAINT IF EXISTS uq_commenthistory;
 
 ALTER TABLE icinga_comments ADD CONSTRAINT uq_comments UNIQUE (instance_id,object_id,comment_time,internal_comment_id);
 ALTER TABLE icinga_commenthistory ADD CONSTRAINT uq_commenthistory UNIQUE (instance_id,object_id,comment_time,internal_comment_id);





More information about the icinga-checkins mailing list