<?xml version="1.0" encoding="UTF-8"?>
<changelog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <changeset id="NO-TICKET_gm_nr_profiles:1" author="rshield">
        <cypherquery>
            MATCH (identity:Identity {email: 'gmaroulis@theorchard.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: 'Georgios Maroulis',
                uuid: apoc.create.uuid(),
                roles: ['manage_nr_repertoire', 'review_digital_audio', 'view_orchard_sound_recording', 'manage_nr_ownership'],
                fullCatalogAccess: true
            })
            MERGE (identity)-[:HAS_PROFILE]->(profile)
            WITH profile
            MATCH (v:Vendor {id: '*'})
            MERGE (profile)-[:HAS_ACCESS_TO]->(v)
            RETURN profile.profileId
        </cypherquery>
    </changeset>
    <changeset id='NO-TICKET_gm_nr_profiles:2' author='rshield'>
        <cypherquery>
                MATCH (identity:Identity {email: 'gmaroulis@theorchard.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: 'DistributionProfile',
                        profileName: 'Georgios Maroulis',
                        roles: ['manage_nr_deliveries', 'deliver_physical_audio'],
                        uuid: apoc.create.uuid(),
                        fullCatalogAccess: true
                    })
                    MERGE (identity)-[:HAS_PROFILE]->(profile)
                    WITH profile
                    MATCH (v:Vendor {id: '*'})
                    MERGE (profile)-[:HAS_ACCESS_TO]->(v)
                    RETURN profile.profileId
        </cypherquery>
    </changeset>

</changelog>
