<?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-4254_sme_uk_users: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: 'sme',
                    profileId: (increment.id-1),
                    profileType: 'AudienceProfile',
                    profileName: 'Nayan Bhattacharjee',
                    roles: ['audience'],
                    fullCatalogAccess: false,
                    uuid: apoc.create.uuid(),
                    createdAt: datetime(),
                    lastModifiedAt: datetime(),
                    createdBy: 'https://theorchard.atlassian.net/browse/FS-4254',
                    updatedBy: 'https://theorchard.atlassian.net/browse/FS-4254'
                })
                WITH profile
                MATCH (v1:Vendor {id: 34588 })
                MERGE (profile)-[:HAS_ACCESS_TO]->(v1)
                WITH profile
                CREATE (identity:Identity{
                    email: 'nayan.bhattacharjee@sonymusic.com',
                    firstName: 'Nayan',
                    lastName: 'Bhattacharjee',
                    name: 'Nayan Bhattacharjee',
                    id:apoc.create.uuid(),
                    active: 'Y',
                    createdAt: datetime(),
                    defaultBrand: 'sme',
                    localization: 'en',
                    numberFormat: 'us',
                    createdBy: 'https://theorchard.atlassian.net/browse/FS-4254',
                    updatedBy: 'https://theorchard.atlassian.net/browse/FS-4254',
                    userTypes: ['label']
                })
                MERGE (identity)-[:HAS_PROFILE]->(profile)
            ]]>
        </neo4j:cypher>
    </changeSet>
    <changeSet id="FS-4254_sme_uk_users: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: 'sme',
                    profileId: (increment.id-1),
                    profileType: 'AudienceProfile',
                    profileName: 'Nour Dib',
                    roles: ['audience'],
                    fullCatalogAccess: false,
                    uuid: apoc.create.uuid(),
                    createdAt: datetime(),
                    lastModifiedAt: datetime(),
                    createdBy: 'https://theorchard.atlassian.net/browse/FS-4254',
                    updatedBy: 'https://theorchard.atlassian.net/browse/FS-4254'
                })
                WITH profile
                MATCH (v1:Vendor {id: 34588 })
                MERGE (profile)-[:HAS_ACCESS_TO]->(v1)
                WITH profile
                CREATE (identity:Identity{
                    email: 'nour.dib@sonymusic.com',
                    firstName: 'Nour',
                    lastName: 'Dib',
                    name: 'Nour Dib',
                    id:apoc.create.uuid(),
                    active: 'Y',
                    createdAt: datetime(),
                    defaultBrand: 'sme',
                    localization: 'en',
                    numberFormat: 'us',
                    createdBy: 'https://theorchard.atlassian.net/browse/FS-4254',
                    updatedBy: 'https://theorchard.atlassian.net/browse/FS-4254',
                    userTypes: ['label']
                })
                MERGE (identity)-[:HAS_PROFILE]->(profile)
            ]]>
        </neo4j:cypher>
    </changeSet>
</databaseChangeLog>
