<?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-6533_create_abacus_profile:1" author="rpashchenko">
        <query>
            MATCH (i:Identity)
            WHERE i.id = '5263db37-6db0-44be-8204-d735b02bba52'
            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-6533_create_abacus_profile:1',
                lastModifiedBy: 'database/ACC-6533_create_abacus_profile:1'
            })
            MERGE (i)-[:HAS_PROFILE]->(p)
            RETURN i,p;
        </query>
    </changeset>
</changelog>
