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

    <changeset id="NR-2001_nr_contributor_vendor_link:1" author="jmarais" run-always="true">
        <cypherquery>
            <![CDATA[
                UNWIND[
                    {id:"fc0ff486-6a17-4a76-8040-4f7aa6278ce6"},
                    {id:"196f360d-eefe-4b9d-9551-52a0b5b625b2"},
                    {id:"8feebaae-a80b-4924-b5ed-b3be9674afef"},
                    {id:"0bc795c3-bfdc-4e5a-9ba6-b19a8b4e83e9"},
                    {id:"8781ad26-ca39-4407-81ca-422099eaffce"},
                    {id:"c3e94aaa-5456-42b7-bade-7ded661aaec1"},
                    {id:"55336565-a692-4943-a30e-66b99bca9b34"},
                    {id:"589c2cc4-52af-4dea-8117-2557025454cd"},
                    {id:"5c9ac70a-dfa3-4095-bfb0-9e37b91f8e58"}
                    ]
                AS contrib
                MATCH(c:NrContributor:NrPerformance {id: contrib.id})<-[r:HAS_NR_CONTRIBUTOR]-(v:Vendor)
                DELETE r
            ]]>

        </cypherquery>
    </changeset>

    <changeset id="NR-2001_nr_contributor_vendor_link:2" author="jmarais" run-always="true">
        <cypherquery>
            <![CDATA[
                UNWIND[
                    {cid:"fc0ff486-6a17-4a76-8040-4f7aa6278ce6", vid: 81803},
                    {cid:"196f360d-eefe-4b9d-9551-52a0b5b625b2", vid: 82149},
                    {cid:"8feebaae-a80b-4924-b5ed-b3be9674afef", vid: 82341},
                    {cid:"0bc795c3-bfdc-4e5a-9ba6-b19a8b4e83e9", vid: 83116},
                    {cid:"8781ad26-ca39-4407-81ca-422099eaffce", vid: 83144},
                    {cid:"c3e94aaa-5456-42b7-bade-7ded661aaec1", vid: 83117},
                    {cid:"55336565-a692-4943-a30e-66b99bca9b34", vid: 83147},
                    {cid:"589c2cc4-52af-4dea-8117-2557025454cd", vid: 83149},
                    {cid:"5c9ac70a-dfa3-4095-bfb0-9e37b91f8e58", vid: 83382}
                ]
                AS cv
                MATCH(c:NrContributor:NrPerformance {id: cv.cid})
                MATCH(v:Vendor {vendorId: cv.vid})
                WITH v, c
                MERGE (v)-[r:HAS_NR_CONTRIBUTOR]->(c)
                ON CREATE SET
                    r.createdAt = datetime(),
                    r.createdBy = '2001_nr_contributor_vendor_link',
                    r.lastModifiedAt = datetime(),
                    r.lastModifiedBy = 'database/NR-2001_nr_contributor_vendor_link'
                ON MATCH SET
                    r.lastModifiedAt = datetime(),
                    r.lastModifiedBy = 'database/NR-2001_nr_contributor_vendor_link'
            ]]>

        </cypherquery>
    </changeset>
</changelog>
