<?xml version="1.0" encoding="UTF-8"?>
<changelog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.liquigraph.org/schema/1.0/liquigraph.xsd">
    <changeset id="ARTARCH-459_update_artist:1" author="savva" run-on-change="true">
        <query>
            MATCH (masterNode:LabelParticipant {id:736707})
            MATCH (otherNode:LabelParticipant)
            WHERE otherNode.id IN [123750077, 124940335, 126916973]
            WITH masterNode, COLLECT(otherNode) AS otherNodes
            CALL apoc.refactor.mergeNodes(
                [masterNode] + otherNodes,
                {
                    properties: "discard",
                    mergeRels: true
                }
            ) YIELD node
            RETURN masterNode
        </query>
    </changeset>
    <changeset id="ARTARCH-459_update_artist:2" author="savva" run-on-change="true">
        <query>
            MATCH (:LabelParticipant {id:736707})-[r:HAS_LABEL_PARTICIPANT]-(:Vendor)
            WITH TAIL(COLLECT(r)) AS duplicates
            UNWIND duplicates AS dup
            DELETE dup
        </query>
    </changeset>
</changelog>
