<?xml version="1.0" encoding="UTF-8"?>
<changelog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.liquigraph.org/schema/1.0/liquigraph.xsd">
    <changeset id="ACC-6343_create_abacus_profile:1" author="rpashchenko" run-on-change="true">
        <query>
            MATCH (i:Identity)
            WHERE i.email = 'ratoui@sonymusic-pde.com'
            MERGE (increment:IncrementId {nodeName: 'Profile'})
            ON CREATE SET increment.id = 2
            ON MATCH SET increment.id = increment.id + 1
            CREATE (p:Profile {
            profileId: (increment.id-1),
            profileType: 'AbacusProfile',
            profileName: i.name,
            uuid: apoc.create.uuid(),
            roles: ['administrator'],
            fullCatalogAccess: true,
            brand: 'orchard',
            createdAt: datetime(),
            lastModifiedAt: datetime(),
            createdBy: 'database/ACC-6343_create_abacus_profile:1',
            lastModifiedBy: 'database/ACC-6343_create_abacus_profile:1'
            })
            MERGE (i)-[:HAS_PROFILE]->(p)
            RETURN i,p;
        </query>
    </changeset>
</changelog>
