<?xml version="1.0" encoding="UTF-8"?>
<changelog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://www.liquigraph.org/schema/1.0/liquigraph.xsd">
    <changeset id="PLATFORM-2954_Rerun_Backfill-settingsprofile:1" author="npatel" run-on-change="true" run-always="true">
        <query>
            <![CDATA[
            MATCH(sp:Profile {profileType: 'SettingsProfile' })<-[:HAS_PROFILE]-(i:Identity)-[:HAS_PROFILE]->(lp:Profile { profileType: 'LabelProfile'})-[:HAS_ACCESS_TO]->(r)
            WHERE 'administrator' in lp.roles
            AND (r:Vendor OR r:Subaccount)
            AND NOT (sp)-[:HAS_ADMIN_ACCESS_TO]->(r)
            CREATE (sp)-[rel:HAS_ADMIN_ACCESS_TO]->(r)
              SET rel.updatedOn = datetime(), rel.lastUpdatedBy = 'PLATFORM-2954_backfill'
            ]]>
        </query>
    </changeset>
</changelog>
