<?xml version="1.0" encoding="UTF-8"?>
<changelog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://www.liquigraph.org/schema/1.0/liquigraph.xsd">
    <changeset id="PUB-1019_add_content_profiles:1" author="rshield" run-always="true">
        <query>
            <![CDATA[
                MATCH (identity:Identity {email: "alberto.montoya@sonymusic-pde.com"})
                MERGE (increment:IncrementId {nodeName: 'Profile'})
                    ON CREATE SET increment.id = 2
                    ON MATCH SET increment.id = increment.id + 1
                CREATE (profile:Profile {
                    profileId: (increment.id - 1),
                    profileType: 'ContentProfile',
                    profileName: identity.name,
                    brand: identity.defaultBrand,
                    fullCatalogAccess: true,
                    roles: ['publishing_compositions_changelog'],
                    uuid: apoc.create.uuid()
                })
                MERGE (identity)-[:HAS_PROFILE]->(profile)
                WITH profile
                MATCH (vendor:Vendor {id: '*'})
                MERGE (profile)-[:HAS_ACCESS_TO]->(vendor)
            ]]>
        </query>
    </changeset>
    <changeset id="PUB-1019_add_content_profiles:2" author="rshield" run-always="true">
        <query>
            <![CDATA[
                MATCH (identity:Identity {email: "vmukan@sonymusic-pde.com"})
                MERGE (increment:IncrementId {nodeName: 'Profile'})
                    ON CREATE SET increment.id = 2
                    ON MATCH SET increment.id = increment.id + 1
                CREATE (profile:Profile {
                    profileId: (increment.id - 1),
                    profileType: 'ContentProfile',
                    profileName: identity.name,
                    brand: identity.defaultBrand,
                    fullCatalogAccess: true,
                    roles: ['publishing_compositions_changelog'],
                    uuid: apoc.create.uuid()
                })
                MERGE (identity)-[:HAS_PROFILE]->(profile)
                WITH profile
                MATCH (vendor:Vendor {id: '*'})
                MERGE (profile)-[:HAS_ACCESS_TO]->(vendor)
            ]]>
        </query>
    </changeset>
    <changeset id="PUB-1019_add_content_profiles:3" author="rshield" run-always="true">
        <query>
            <![CDATA[
                MATCH (identity:Identity {email: "xmeunier@sonymusic-pde.com"})
                MERGE (increment:IncrementId {nodeName: 'Profile'})
                    ON CREATE SET increment.id = 2
                    ON MATCH SET increment.id = increment.id + 1
                CREATE (profile:Profile {
                    profileId: (increment.id - 1),
                    profileType: 'ContentProfile',
                    profileName: identity.name,
                    brand: identity.defaultBrand,
                    fullCatalogAccess: true,
                    roles: ['publishing_compositions_changelog'],
                    uuid: apoc.create.uuid()
                })
                MERGE (identity)-[:HAS_PROFILE]->(profile)
                WITH profile
                MATCH (vendor:Vendor {id: '*'})
                MERGE (profile)-[:HAS_ACCESS_TO]->(vendor)
            ]]>
        </query>
    </changeset>
    <changeset id="PUB-1019_add_content_profiles:4" author="rshield" run-always="true">
        <query>
            <![CDATA[
                MATCH (identity:Identity {email: "jorge.bertran@sonymusic-pde.com"})
                MERGE (increment:IncrementId {nodeName: 'Profile'})
                    ON CREATE SET increment.id = 2
                    ON MATCH SET increment.id = increment.id + 1
                CREATE (profile:Profile {
                    profileId: (increment.id - 1),
                    profileType: 'ContentProfile',
                    profileName: identity.name,
                    brand: identity.defaultBrand,
                    fullCatalogAccess: true,
                    roles: ['publishing_compositions_changelog'],
                    uuid: apoc.create.uuid()
                })
                MERGE (identity)-[:HAS_PROFILE]->(profile)
                WITH profile
                MATCH (vendor:Vendor {id: '*'})
                MERGE (profile)-[:HAS_ACCESS_TO]->(vendor)
            ]]>
        </query>
    </changeset>
    <changeset id="PUB-1019_add_content_profiles:5" author="rshield" run-always="true">
        <query>
            <![CDATA[
                UNWIND[
                'jmarais@sonymusic-pde.com',
                'ratoui@sonymusic-pde.com',
                'rshield@sonymusic-pde.com',
                'yostapyuk@sonymusic-pde.com',
                'fholland@sonymusic-pde.com',
                'tdenkinger@sonymusic-pde.com',
                'ajaiswal@sonymusic-pde.com',
                'ccapalbo@sonymusic-pde.com',
                'apavlov@sonymusic-pde.com'
                ] AS e
                MATCH (identity:Identity {email:e})-[:HAS_PROFILE]->(p:Profile {profileType: 'ContentProfile'})
                SET p.roles = p.roles + 'publishing_compositions_changelog'
            ]]>
        </query>
    </changeset>
</changelog>
