<?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-4771_orchard_fansifter_users_access_update: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: 'Mohammed Kamara',
                    roles: ['audience'],
                    fullCatalogAccess: false,
                    uuid: apoc.create.uuid(),
                    createdAt: datetime(),
                    lastModifiedAt: datetime(),
                    createdBy: 'https://theorchard.atlassian.net/browse/FS-4771',
                    updatedBy: 'https://theorchard.atlassian.net/browse/FS-4771'
                })
                WITH profile
                MATCH (i:Identity {id: '2c1032fa-17f4-4987-92fa-70293564fc97' }),
                    (v1:Vendor {id: 82477 })
                MERGE (profile)-[:HAS_ACCESS_TO]->(v1)
                WITH profile,i
                MERGE (i)-[:HAS_PROFILE]->(profile)
            ]]>
        </neo4j:cypher>
    </changeSet>
    <changeSet id="FS-4771_orchard_fansifter_users_access_update: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: 'Shannon Silver',
                    roles: ['audience'],
                    fullCatalogAccess: false,
                    uuid: apoc.create.uuid(),
                    createdAt: datetime(),
                    lastModifiedAt: datetime(),
                    createdBy: 'https://theorchard.atlassian.net/browse/FS-4771',
                    updatedBy: 'https://theorchard.atlassian.net/browse/FS-4771'
                })
                WITH profile
                MATCH (i:Identity {id: 'e67f1406-8487-45ef-9ec3-ab62c3481c37' }),
                    (v1:Vendor {id: 82477 })
                MERGE (profile)-[:HAS_ACCESS_TO]->(v1)
                WITH profile,i
                MERGE (i)-[:HAS_PROFILE]->(profile)
            ]]>
        </neo4j:cypher>
    </changeSet>
    <changeSet id="FS-4771_orchard_fansifter_users_access_update:3" 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: 'Margaret Lee',
                    roles: ['audience'],
                    fullCatalogAccess: false,
                    uuid: apoc.create.uuid(),
                    createdAt: datetime(),
                    lastModifiedAt: datetime(),
                    createdBy: 'https://theorchard.atlassian.net/browse/FS-4771',
                    updatedBy: 'https://theorchard.atlassian.net/browse/FS-4771'
                })
                WITH profile
                MATCH (i:Identity {id: '2473aef0-fea3-4f25-8c30-77d931b3f45f' }),
                    (v1:Vendor {id: 82477 })
                MERGE (profile)-[:HAS_ACCESS_TO]->(v1)
                WITH profile,i
                MERGE (i)-[:HAS_PROFILE]->(profile)
            ]]>
        </neo4j:cypher>
    </changeSet>
</databaseChangeLog>
