From 52f0fc917790b4f4b646a208b6fa34edb9cf1603 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Wed, 7 Dec 2016 09:48:52 +0100 Subject: [PATCH] schema: fix cleanup in recent service_set migration fixes #13401 --- schema/mysql-migrations/upgrade_123.sql | 2 +- schema/pgsql-migrations/upgrade_123.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/schema/mysql-migrations/upgrade_123.sql b/schema/mysql-migrations/upgrade_123.sql index 80b24fa4..024ed72b 100644 --- a/schema/mysql-migrations/upgrade_123.sql +++ b/schema/mysql-migrations/upgrade_123.sql @@ -8,7 +8,7 @@ DELETE ss FROM icinga_service_set AS ss -- cleanup dangling services to service_set DELETE s FROM icinga_service AS s LEFT JOIN icinga_service_set AS ss ON ss.id = s.service_set_id - WHERE s.object_type = 'object' + WHERE s.object_type IN ('object', 'apply') AND s.service_set_id IS NOT NULL AND ss.id IS NULL; diff --git a/schema/pgsql-migrations/upgrade_123.sql b/schema/pgsql-migrations/upgrade_123.sql index 77005f82..bc978547 100644 --- a/schema/pgsql-migrations/upgrade_123.sql +++ b/schema/pgsql-migrations/upgrade_123.sql @@ -13,7 +13,7 @@ DELETE FROM icinga_service AS s SELECT 1 FROM icinga_service_set AS ss WHERE ss.id = s.service_set_id ) - AND object_type = 'object' + AND object_type IN ('object', 'apply') AND service_set_id IS NOT NULL;