<?xml version="1.0" encoding="UTF-8"?>
<changelog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="./schema.xsd">
    <changeset id="PLATFORM-Fix-all-duplicate-id-profile-relationships.xml" author="asampath">
        <cypherquery>
            <![CDATA[
                MATCH (i:Identity)-[rel:HAS_PROFILE]->(p:Profile)
                WITH count(rel) as rel_count, COLLECT(rel) AS rels, p,i
                WHERE rel_count > 1 WITH rel_count,rels,p,i
                FOREACH (x IN TAIL(rels) | DELETE x)
		]]>
        </cypherquery>
    </changeset>
</changelog>
