<?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="PLATFORM-3385_hwilson_publishingprofile:1" author="ahan">
        <cypherquery>
            <![CDATA[
            MATCH (identity:Identity {email: 'hwilson@theorchard.com'})
            MERGE (increment:IncrementId {nodeName: 'Profile'})
                ON MATCH SET increment.id = increment.id + 1
            MERGE (identity)-[:HAS_PROFILE]->(profile:Profile {profileType: 'PublishingProfile'})
                ON CREATE SET
                    profile.profileId = increment.id-1,
                    profile.profileName = 'PublishingProfile',
                    profile.roles = ['admin'],
                    profile.uuid = apoc.create.uuid(),
                    profile.createdOn = localdatetime(),
                    profile.createdBy = 'PLATFORM-3385'
            WITH profile
            MATCH (v:Vendor {id: '*'})
            MERGE (profile)-[:HAS_ACCESS_TO]->(v)
            ]]>
        </cypherquery>
    </changeset>
</changelog>
