<?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-4031_fat_possum_admins: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: 'Patrick Addison',
                    roles: ['audience'],
                    fullCatalogAccess: false,
                    uuid: apoc.create.uuid(),
                    createdAt: datetime(),
                    lastModifiedAt: datetime(),
                    createdBy: 'https://theorchard.atlassian.net/browse/FS-4031',
                    updatedBy: 'https://theorchard.atlassian.net/browse/FS-4031'
                })
                WITH profile
                MATCH (i:Identity {id: '4eb279de-70d6-478a-9ce8-28585cdcdb13' }),
                    (v1:Vendor {id: 22221 })
                MERGE (profile)-[:HAS_ACCESS_TO]->(v1)
                WITH profile,i
                MERGE (i)-[:HAS_PROFILE]->(profile)
            ]]>
        </neo4j:cypher>
    </changeSet>
    <changeSet id="FS-4031_fat_possum_admins:2" 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: 'Bronwyn Ford',
                    roles: ['audience'],
                    fullCatalogAccess: false,
                    uuid: apoc.create.uuid(),
                    createdAt: datetime(),
                    lastModifiedAt: datetime(),
                    createdBy: 'https://theorchard.atlassian.net/browse/FS-4031',
                    updatedBy: 'https://theorchard.atlassian.net/browse/FS-4031'
                })
                WITH profile
                MATCH (i:Identity {id: 'd25d1e97-391e-4f8e-b59d-acb595e38300' }),
                    (v1:Vendor {id: 22221 })
                MERGE (profile)-[:HAS_ACCESS_TO]->(v1)
                WITH profile,i
                MERGE (i)-[:HAS_PROFILE]->(profile)
            ]]>
        </neo4j:cypher>
    </changeSet>
</databaseChangeLog>
