- All Implemented Interfaces:
- com.atlassian.activeobjects.external.ActiveObjectsUpgradeTask
public class V46RemoveOrphanRequirementsUpgradeTask
extends Object
implements com.atlassian.activeobjects.external.ActiveObjectsUpgradeTask
A customer has ACTIVE requirements which don't have any ORIGINAL link.
Let's change their status to DELETED when they don't have any ORIGINAL_PAGE, ORIGINAL_EXCEL, or ORIGINAL_IMPORTED.
Ideally, we'd just execute the following, but it's ActiveObjects
select * from "AO_32F7CE_AOREQUIREMENT" where "ID" NOT IN (SELECT "PARENT_ID" from "AO_32F7CE_AOREQUIREMENT_LINK" where "TYPE" in ('ORIGINAL_PAGE', 'ORIGINAL_EXCEL'))
We'll use the streaming api to store all AOLink.PARENT_ID. We'll then search in AOReq and mark deleted all those that
don't match.
We've optimized to avoid using more than 2MB memory.