<?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-552_artist_update:1" author="savva" run-on-change="true">
        <query>
            <![CDATA[
                //Change spotifyId to tne correct one
                MATCH (lp:LabelParticipant {uuid: '339c17c6-4d56-4272-9c71-0da8ab2f0e15'})
                WHERE lp.name = 'Max' AND lp.spotifyId = '1bqxdqvUtPWZri43cKHac8'
                SET lp.spotifyId = '0M5XgwZq3BoGzkTvG9Lwb2'

                //Remove invalid connection to the other GlobalParticipant
                WITH lp
                MATCH (lp)<-[r:REPRESENTS]-(incorrectGp:GlobalParticipant {id: 'fa7b0875-6492-4392-964e-d68bb4bbcd76'})
                WHERE incorrectGp.name = 'MAX' AND incorrectGp.spotifyId = '1bqxdqvUtPWZri43cKHac8'
                DELETE r

                //Create a new connection to the correct GlobalParticipant
                WITH lp
                MATCH (correctGp:GlobalParticipant {id: 'fdf014fe-eec4-4882-9041-9dcb5bc127fb'})
                WHERE correctGp.name = 'Max' and correctGp.spotifyId = '0M5XgwZq3BoGzkTvG9Lwb2'
                MERGE (lp)<-[r:REPRESENTS]-(correctGp)
            ]]>
        </query>
    </changeset>
    <changeset id="ARTARCH-552_artist_update:2" author="savva" run-on-change="true">
        <query>
            <![CDATA[
                MATCH (pp:PublicParticipant {id: '86aa8818-7c6b-4fc8-8fd5-1db223dba5ba'})
                MATCH (psr:PublicSoundRecording {id: '7e0be896-d6fd-4088-be9e-94228047b5d6'})
                MATCH (pp)-[r:PARTICIPATED_IN]->(psr)
                DELETE r
            ]]>
        </query>
    </changeset>
</changelog>
