<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                   xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
                   xmlns:neo4j="http://www.liquibase.org/xml/ns/dbchangelog-ext"
                   xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd">
    <changeSet id="FS-5073_jada_penrow_orchard_access:1" author="ozhovnuvatyi">
        <neo4j:cypher>
            <![CDATA[
                MERGE (increment:IncrementId {nodeName: 'Profile'})
                    ON CREATE SET increment.id = 2
                    ON MATCH SET increment.id = increment.id + 1
                CREATE (profile:Profile {
                    brand: 'theorchard',
                    profileId: (increment.id-1),
                    profileType: 'AudienceProfile',
                    profileName: 'Jada Penrow',
                    roles: ['audience'],
                    fullCatalogAccess: false,
                    uuid: apoc.create.uuid(),
                    createdAt: datetime(),
                    lastModifiedAt: datetime(),
                    createdBy: 'https://theorchard.atlassian.net/browse/FS-5073',
                    updatedBy: 'https://theorchard.atlassian.net/browse/FS-5073'
                })
                WITH profile
                MATCH (i:Identity {id: '2ea0a1f5-525d-4627-a156-34bcc6bbc1f3' }),
                    (v1:Vendor {id: 82477 })
                MERGE (profile)-[:HAS_ACCESS_TO]->(v1)
                WITH profile,i
                MERGE (i)-[:HAS_PROFILE]->(profile)
            ]]>
        </neo4j:cypher>
    </changeSet>
</databaseChangeLog>
