<?xml version="1.0" encoding="UTF-8"?>
<changelog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

    <changeset id="NR-1494_Delete_dupe_edges:1" author="npatel" run-always="true">
        <cypherquery>
            <![CDATA[          
                MATCH (start:NrContributor:NrPerformance)-
                    [rel:IS_MAIN_PERFORMER | IS_FEATURING_PERFORMER | IS_SESSION_MUSICIAN]->
                    (end:NrContribution:NrPerformance)
                WITH start, end, collect(rel) as allRel, count(rel) as countRels, collect(distinct type(rel)) as typesRel

                WHERE countRels > 1 
                with start, end, allRel, count(typesRel) as typesRelCount
                where typesRelCount = 1

                CALL apoc.refactor.mergeRelationships(allRel, {properties:"discard"})
                YIELD rel

                RETURN rel             
          ]]>
        </cypherquery>
    </changeset>

</changelog>
