[icinga-checkins] icinga.org: icinga2/master: Fix incorrect session_token index for PostgreSQL

git at icinga.org git at icinga.org
Mon Aug 1 17:52:50 CEST 2016


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

Author: Michael Friedrich <michael.friedrich at netways.de>
Date:   Mon Aug  1 15:04:47 2016 +0200

Fix incorrect session_token index for PostgreSQL

refs #12210

---

 lib/db_ido_pgsql/schema/pgsql.sql         |    6 +++---
 lib/db_ido_pgsql/schema/upgrade/2.5.0.sql |    6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/lib/db_ido_pgsql/schema/pgsql.sql b/lib/db_ido_pgsql/schema/pgsql.sql
index 9adf640..f67e6e7 100644
--- a/lib/db_ido_pgsql/schema/pgsql.sql
+++ b/lib/db_ido_pgsql/schema/pgsql.sql
@@ -1691,9 +1691,9 @@ CREATE INDEX idx_zones_parent_object_id on icinga_zones(parent_zone_object_id);
 CREATE INDEX idx_zonestatus_parent_object_id on icinga_zonestatus(parent_zone_object_id);
 
 -- #12210
-CREATE INDEX idx_hg_session_del ON icinga_hostgroup_members (session_token);
-CREATE INDEX idx_sg_session_del ON icinga_servicegroup_members (session_token);
-CREATE INDEX idx_cg_session_del ON icinga_contactgroup_members (session_token);
+CREATE INDEX idx_hg_session_del ON icinga_hostgroup_members (instance_id, session_token);
+CREATE INDEX idx_sg_session_del ON icinga_servicegroup_members (instance_id, session_token);
+CREATE INDEX idx_cg_session_del ON icinga_contactgroup_members (instance_id, session_token);
 
 DROP INDEX cv_session_del_idx;
 DROP INDEX cvs_session_del_idx;
diff --git a/lib/db_ido_pgsql/schema/upgrade/2.5.0.sql b/lib/db_ido_pgsql/schema/upgrade/2.5.0.sql
index db05ca4..ed52b2b 100644
--- a/lib/db_ido_pgsql/schema/upgrade/2.5.0.sql
+++ b/lib/db_ido_pgsql/schema/upgrade/2.5.0.sql
@@ -46,9 +46,9 @@ ALTER TABLE icinga_hostgroup_members ADD COLUMN session_token INTEGER default NU
 ALTER TABLE icinga_servicegroup_members ADD COLUMN session_token INTEGER default NULL;
 ALTER TABLE icinga_contactgroup_members ADD COLUMN session_token INTEGER default NULL;
 
-CREATE INDEX idx_hg_session_del ON icinga_hostgroup_members (session_token);
-CREATE INDEX idx_sg_session_del ON icinga_servicegroup_members (session_token);
-CREATE INDEX idx_cg_session_del ON icinga_contactgroup_members (session_token);
+CREATE INDEX idx_hg_session_del ON icinga_hostgroup_members (instance_id, session_token);
+CREATE INDEX idx_sg_session_del ON icinga_servicegroup_members (instance_id, session_token);
+CREATE INDEX idx_cg_session_del ON icinga_contactgroup_members (instance_id, session_token);
 
 DROP INDEX cv_session_del_idx;
 DROP INDEX cvs_session_del_idx;



More information about the icinga-checkins mailing list