<?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="SWITCH-1707_update_participation_roles:1" author="owright">
        <query>
            <![CDATA[
                MATCH (visualProductionContributor:ParticipationRoleCategory { name: "Visual Production Contributor" })
                    WITH visualProductionContributor
                    MATCH (armourerRole:ParticipationRole { name: "Armourer" })
                        MATCH (:ParticipationRoleCategory)<-[r:BELONGS_TO]-(armourerRole)
                        DELETE r
                        MERGE (visualProductionContributor)<-[:BELONGS_TO]-(armourerRole)
                    WITH visualProductionContributor
                    MATCH (artDirectorRole:ParticipationRole { name: "Art Director" })
                        MATCH (:ParticipationRoleCategory)<-[r:BELONGS_TO]-(artDirectorRole)
                        DELETE r
                        MERGE (visualProductionContributor)<-[:BELONGS_TO]-(artDirectorRole)
                    WITH visualProductionContributor
                    MATCH (assistantEditorRole:ParticipationRole { name: "Assistant Editor" })
                        MATCH (:ParticipationRoleCategory)<-[r:BELONGS_TO]-(assistantEditorRole)
                        DELETE r
                        MERGE (visualProductionContributor)<-[:BELONGS_TO]-(assistantEditorRole)
                    WITH visualProductionContributor
                    MATCH (assistantVisualEditorRole:ParticipationRole { name: "Assistant Visual Editor" })
                        MATCH (:ParticipationRoleCategory)<-[r:BELONGS_TO]-(assistantVisualEditorRole)
                        DELETE r
                        MERGE (visualProductionContributor)<-[:BELONGS_TO]-(assistantVisualEditorRole);
            ]]>
        </query>
    </changeset>

    <changeset id="SWITCH-1707_update_participation_roles:2" author="owright">
        <query>
            <![CDATA[
                MATCH (printMediaContributor:ParticipationRoleCategory { name: "Print Media Contributor" })
                    WITH printMediaContributor
                    MATCH (artCopyistRole:ParticipationRole { name: "Art Copyist" })
                        MATCH (:ParticipationRoleCategory)<-[r:BELONGS_TO]-(artCopyistRole)
                        DELETE r
                        MERGE (printMediaContributor)<-[:BELONGS_TO]-(artCopyistRole);
            ]]>
        </query>
    </changeset>

    <changeset id="SWITCH-1707_update_participation_roles:3" author="owright">
        <query>
            <![CDATA[
                MATCH (generic:ParticipationRoleCategory { name: "Generic" })
                    WITH generic
                    MATCH (copyrightClaimantRole:ParticipationRole { name: "Copyright Claimant" })
                        MATCH (:ParticipationRoleCategory)<-[r:BELONGS_TO]-(copyrightClaimantRole)
                        DELETE r
                        MERGE (generic)<-[:BELONGS_TO]-(copyrightClaimantRole)
                    WITH generic
                    MATCH (copyrightHolderRole:ParticipationRole { name: "Copyright Holder" })
                        MATCH (:ParticipationRoleCategory)<-[r:BELONGS_TO]-(copyrightHolderRole)
                        DELETE r
                        MERGE (generic)<-[:BELONGS_TO]-(copyrightHolderRole)
                    WITH generic
                    MATCH (musicPublisherRole:ParticipationRole { name: "Music Publisher" })
                        MATCH (:ParticipationRoleCategory)<-[r:BELONGS_TO]-(musicPublisherRole)
                        DELETE r
                        MERGE (generic)<-[:BELONGS_TO]-(musicPublisherRole)
                    WITH generic
                    MATCH (distributionCompanyRole:ParticipationRole { name: "Distribution Company" })
                        MATCH (:ParticipationRoleCategory)<-[r:BELONGS_TO]-(distributionCompanyRole)
                        DELETE r
                        MERGE (generic)<-[:BELONGS_TO]-(distributionCompanyRole)
                    WITH generic
                    MATCH (initialProducerRole:ParticipationRole { name: "Initial Producer" })
                        MATCH (:ParticipationRoleCategory)<-[r:BELONGS_TO]-(initialProducerRole)
                        DELETE r
                        MERGE (generic)<-[:BELONGS_TO]-(initialProducerRole)
                    WITH generic
                    MATCH (productionDepartmentsRole:ParticipationRole { name: "Production Departments" })
                        MATCH (:ParticipationRoleCategory)<-[r:BELONGS_TO]-(productionDepartmentsRole)
                        DELETE r
                        MERGE (generic)<-[:BELONGS_TO]-(productionDepartmentsRole)
                    WITH generic
                    MATCH (rightsControllerOnProductRole:ParticipationRole { name: "Rights Controller on Product" })
                        MATCH (:ParticipationRoleCategory)<-[r:BELONGS_TO]-(rightsControllerOnProductRole)
                        DELETE r
                        MERGE (generic)<-[:BELONGS_TO]-(rightsControllerOnProductRole);
            ]]>
        </query>
    </changeset>
</changelog>
