<?xml version="1.0" encoding="UTF-8"?>
<changelog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="./schema.xsd">
    <changeset id="DISTRO-4868_clear_acrids:1" author="pdumoulin" run-always="true">
        <precondition>
            <sqlquery>
                <![CDATA[
                SELECT
                    acr.ID AS ACR_ID
                FROM facts.prod.ACRID AS acr
                WHERE acr.CREATED_BY = 'ows-sound-recordings/post-acrids'
                AND acr.CREATED_AT < '2022-03-30'
                ;
                ]]>
            </sqlquery>
        </precondition>
        <cypherquery>
            <![CDATA[
            MATCH(acr:ACRID)<-[x:FINGERPRINTED_AS]-(oa:OrchardAsset)
            WHERE acr.id = event.ACR_ID
            DELETE x
            ;
            ]]>
        </cypherquery>
    </changeset>
</changelog>
