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;