schema: fix cleanup in recent service_set migration

fixes #13401
This commit is contained in:
Thomas Gelf 2016-12-07 09:48:52 +01:00
parent 1acf332f6b
commit 52f0fc9177
2 changed files with 2 additions and 2 deletions

View File

@ -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;

View File

@ -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;