<?xml version="1.0" encoding="UTF-8"?>
<changelog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="./schema.xsd">
    <changeset id="PLATFORM-3368_create_abacus_profile:1" author="asampath">
      <cypherquery>
        <![CDATA[
            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:'AbacusProfile',
                profileName:'Abacus Account Creation - AbacusProfile',
                roles:['administrator'],
                fullCatalogAccess:true,
                uuid:apoc.create.uuid()
            })
            WITH profile
            MATCH (vendor:Vendor {id: '*'})
            MERGE (profile)-[:HAS_ACCESS_TO]->(vendor)
            WITH profile
            CREATE (identity:Identity{
                email:'m2m_abacus_admin@theorchard.com',
                name:'Abacus Account Creation',
                id:apoc.create.uuid()
            })
            CREATE(identity)-[:HAS_PROFILE]->(profile)
        ]]>
      </cypherquery>
    </changeset>
</changelog>
