<?xml version="1.0" encoding="UTF-8"?>
<changelog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <changeset id="NR-1901_add_service_id:1" author="rshield" run-on-change="true">
        <cypherquery>
            <![CDATA[
            MERGE (i:Identity {email: "reporter@nr-ownership.io"})
            ON CREATE SET
                i.id = apoc.create.uuid(),
                i.localization = "en",
                i.lastName = "service user",
                i.defaultBrand = "theorchard",
                i.active = "Y",
                i.createdAt = datetime(),
                i.firstName = "reporting",
                i.numberFormat = "us",
                i.name = "reporting service user"
            ON MATCH SET
                i.updatedOn = datetime(),
                i.updatedBy = "NR-1901_add_service_id.xml"
        ]]>
        </cypherquery>
    </changeset>
    <changeset id="NR-1901_add_service_id:2" author="rshield" run-on-change="true">
        <cypherquery>
            <![CDATA[
            MATCH (i:Identity {email: "reporter@nr-ownership.io"})
                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: 'ownership reporting service ContentProfile',
                    uuid: apoc.create.uuid(),
                    roles: ['view_orchard_sound_recording']
            })
            MERGE (i)-[:HAS_PROFILE]->(profile)
        ]]>
        </cypherquery>
    </changeset>
</changelog>
