<?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-4090_add_new_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: 'Jennifer Adedo',
                    roles: ['audience'],
                    fullCatalogAccess: false,
                    uuid: apoc.create.uuid(),
                    createdAt: datetime(),
                    lastModifiedAt: datetime(),
                    createdBy: 'https://theorchard.atlassian.net/browse/FS-4090',
                    updatedBy: 'https://theorchard.atlassian.net/browse/FS-4090'
                })
                WITH profile
                MATCH (i:Identity {id: '005aa508-492f-43b7-a667-0e6e4ff57466' }),
                    (v1:Vendor {id: 34588 })
                MERGE (profile)-[:HAS_ACCESS_TO]->(v1)
                WITH profile,i
                MERGE (i)-[:HAS_PROFILE]->(profile)
            ]]>
        </neo4j:cypher>
    </changeSet>
    <changeSet id="FS-4090_add_new_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: 'Renee Karsdorf',
                    roles: ['audience'],
                    fullCatalogAccess: false,
                    uuid: apoc.create.uuid(),
                    createdAt: datetime(),
                    lastModifiedAt: datetime(),
                    createdBy: 'https://theorchard.atlassian.net/browse/FS-4090',
                    updatedBy: 'https://theorchard.atlassian.net/browse/FS-4090'
                })
                WITH profile
                MATCH (v1:Vendor {id: 34588 })
                MERGE (profile)-[:HAS_ACCESS_TO]->(v1)
                WITH profile
                CREATE (identity:Identity{
                    email: 'renee.karsdorf@sonymusic.com',
                    firstName: 'Renee',
                    lastName: 'Karsdorf',
                    name: 'Renee Karsdorf',
                    id:apoc.create.uuid(),
                    active: 'Y',
                    createdAt: datetime(),
                    defaultBrand: 'sme',
                    localization: 'en',
                    numberFormat: 'us',
                    createdBy: 'https://theorchard.atlassian.net/browse/FS-4090',
                    updatedBy: 'https://theorchard.atlassian.net/browse/FS-4090',
                    userTypes: ['label']
                })
                MERGE (identity)-[:HAS_PROFILE]->(profile)
            ]]>
        </neo4j:cypher>
    </changeSet>
</databaseChangeLog>
