<?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="WAR-3480_vendor_star_access:1" author="jviletto">
        <neo4j:cypher>
            <![CDATA[
            MATCH (identity:Identity {id: 'a7093a962-5fdc-4400-a872-d26e3cc7cb4c'})
            MERGE (increment:IncrementId {nodeName: 'Profile'})
                ON CREATE SET increment.id = 2
                ON MATCH SET increment.id = increment.id + 1
            CREATE (profile:Profile {
                profileId: (increment.id),
                profileType: 'MoneyhubProfile',
                profileName: identity.name,
                brand: identity.defaultBrand,
                fullCatalogAccess: true,
                roles: ['accounting'],
                uuid: apoc.create.uuid(),
                createdAt: datetime(),
                lastModifiedAt: datetime(),
                createdBy: 'database/WAR-3480_vendor_star_access:1',
                lastModifiedBy: 'database/WAR-3480_vendor_star_access:1'
            })
            MERGE (identity)-[:HAS_PROFILE]->(profile)
            WITH profile
            MATCH (vendor:Vendor {id: '*'})
            MERGE (profile)-[:HAS_ACCESS_TO]->(vendor)
            ]]>
        </neo4j:cypher>
    </changeSet>

    <changeSet id="WAR-3480_vendor_star_access:2" author="jviletto">
        <neo4j:cypher>
            <![CDATA[
            MATCH (identity:Identity {id: 'b810d5d3-0296-45d3-acc1-163096dcd5cd'})
            MERGE (increment:IncrementId {nodeName: 'Profile'})
                ON CREATE SET increment.id = 2
                ON MATCH SET increment.id = increment.id + 1
            CREATE (profile:Profile {
                profileId: (increment.id),
                profileType: 'MoneyhubProfile',
                profileName: identity.name,
                brand: identity.defaultBrand,
                fullCatalogAccess: true,
                roles: ['accounting'],
                uuid: apoc.create.uuid(),
                createdAt: datetime(),
                lastModifiedAt: datetime(),
                createdBy: 'database/WAR-3480_vendor_star_access:2',
                lastModifiedBy: 'database/WAR-3480_vendor_star_access:2'
            })
            MERGE (identity)-[:HAS_PROFILE]->(profile)
            WITH profile
            MATCH (vendor:Vendor {id: '*'})
            MERGE (profile)-[:HAS_ACCESS_TO]->(vendor)
            ]]>
        </neo4j:cypher>
    </changeSet>

    <changeSet id="WAR-3480_vendor_star_access:3" author="jviletto">
        <neo4j:cypher>
            <![CDATA[
            MATCH (identity:Identity {id: 'c7116d90-09af-471b-972a-6f1a5a61b06a'})
            MERGE (increment:IncrementId {nodeName: 'Profile'})
                ON CREATE SET increment.id = 2
                ON MATCH SET increment.id = increment.id + 1
            CREATE (profile:Profile {
                profileId: (increment.id),
                profileType: 'MoneyhubProfile',
                profileName: identity.name,
                brand: identity.defaultBrand,
                fullCatalogAccess: true,
                roles: ['accounting'],
                uuid: apoc.create.uuid(),
                createdAt: datetime(),
                lastModifiedAt: datetime(),
                createdBy: 'database/WAR-3480_vendor_star_access:3',
                lastModifiedBy: 'database/WAR-3480_vendor_star_access:3'
            })
            MERGE (identity)-[:HAS_PROFILE]->(profile)
            WITH profile
            MATCH (vendor:Vendor {id: '*'})
            MERGE (profile)-[:HAS_ACCESS_TO]->(vendor)
            ]]>
        </neo4j:cypher>
    </changeSet>

    <changeSet id="WAR-3480_vendor_star_access:4" author="jviletto">
        <neo4j:cypher>
            <![CDATA[
            MATCH (identity:Identity {id: '21ef4792-8e32-4b22-8057-b2e3d9e42e1d'})
            MERGE (increment:IncrementId {nodeName: 'Profile'})
                ON CREATE SET increment.id = 2
                ON MATCH SET increment.id = increment.id + 1
            CREATE (profile:Profile {
                profileId: (increment.id),
                profileType: 'MoneyhubProfile',
                profileName: identity.name,
                brand: identity.defaultBrand,
                fullCatalogAccess: true,
                roles: ['accounting'],
                uuid: apoc.create.uuid(),
                createdAt: datetime(),
                lastModifiedAt: datetime(),
                createdBy: 'database/WAR-3480_vendor_star_access:4',
                lastModifiedBy: 'database/WAR-3480_vendor_star_access:4'
            })
            MERGE (identity)-[:HAS_PROFILE]->(profile)
            WITH profile
            MATCH (vendor:Vendor {id: '*'})
            MERGE (profile)-[:HAS_ACCESS_TO]->(vendor)
            ]]>
        </neo4j:cypher>
    </changeSet>

    <changeSet id="WAR-3480_vendor_star_access:5" author="jviletto">
        <neo4j:cypher>
            <![CDATA[
            MATCH (identity:Identity {id: '51418536-7e6e-4635-a225-ac4ce4239633'})
            MERGE (increment:IncrementId {nodeName: 'Profile'})
                ON CREATE SET increment.id = 2
                ON MATCH SET increment.id = increment.id + 1
            CREATE (profile:Profile {
                profileId: (increment.id),
                profileType: 'MoneyhubProfile',
                profileName: identity.name,
                brand: identity.defaultBrand,
                fullCatalogAccess: true,
                roles: ['accounting'],
                uuid: apoc.create.uuid(),
                createdAt: datetime(),
                lastModifiedAt: datetime(),
                createdBy: 'database/WAR-3480_vendor_star_access:5',
                lastModifiedBy: 'database/WAR-3480_vendor_star_access:5'
            })
            MERGE (identity)-[:HAS_PROFILE]->(profile)
            WITH profile
            MATCH (vendor:Vendor {id: '*'})
            MERGE (profile)-[:HAS_ACCESS_TO]->(vendor)
            ]]>
        </neo4j:cypher>
    </changeSet>

    <changeSet id="WAR-3480_vendor_star_access:6" author="jviletto">
        <neo4j:cypher>
            <![CDATA[
            MATCH (identity:Identity {id: 'cf7e129d-e797-4be5-af43-83bc168b78e1'})
            MERGE (increment:IncrementId {nodeName: 'Profile'})
                ON CREATE SET increment.id = 2
                ON MATCH SET increment.id = increment.id + 1
            CREATE (profile:Profile {
                profileId: (increment.id),
                profileType: 'MoneyhubProfile',
                profileName: identity.name,
                brand: identity.defaultBrand,
                fullCatalogAccess: true,
                roles: ['accounting'],
                uuid: apoc.create.uuid(),
                createdAt: datetime(),
                lastModifiedAt: datetime(),
                createdBy: 'database/WAR-3480_vendor_star_access:6',
                lastModifiedBy: 'database/WAR-3480_vendor_star_access:6'
            })
            MERGE (identity)-[:HAS_PROFILE]->(profile)
            WITH profile
            MATCH (vendor:Vendor {id: '*'})
            MERGE (profile)-[:HAS_ACCESS_TO]->(vendor)
            ]]>
        </neo4j:cypher>
    </changeSet>

    <changeSet id="WAR-3480_vendor_star_access:7" author="jviletto">
        <neo4j:cypher>
            <![CDATA[
            MATCH (identity:Identity {id: 'a4b795e2-2793-4de5-971a-e888a13e1e7f'})
            MERGE (increment:IncrementId {nodeName: 'Profile'})
                ON CREATE SET increment.id = 2
                ON MATCH SET increment.id = increment.id + 1
            CREATE (profile:Profile {
                profileId: (increment.id),
                profileType: 'MoneyhubProfile',
                profileName: identity.name,
                brand: identity.defaultBrand,
                fullCatalogAccess: true,
                roles: ['accounting'],
                uuid: apoc.create.uuid(),
                createdAt: datetime(),
                lastModifiedAt: datetime(),
                createdBy: 'database/WAR-3480_vendor_star_access:7',
                lastModifiedBy: 'database/WAR-3480_vendor_star_access:7'
            })
            MERGE (identity)-[:HAS_PROFILE]->(profile)
            WITH profile
            MATCH (vendor:Vendor {id: '*'})
            MERGE (profile)-[:HAS_ACCESS_TO]->(vendor)
            ]]>
        </neo4j:cypher>
    </changeSet>

    <changeSet id="WAR-3480_vendor_star_access:8" author="jviletto">
        <neo4j:cypher>
            <![CDATA[
            MATCH (identity:Identity {id: '0f05087f-30d4-4b5c-8e9f-83766a241ffc'})
            MERGE (increment:IncrementId {nodeName: 'Profile'})
                ON CREATE SET increment.id = 2
                ON MATCH SET increment.id = increment.id + 1
            CREATE (profile:Profile {
                profileId: (increment.id),
                profileType: 'MoneyhubProfile',
                profileName: identity.name,
                brand: identity.defaultBrand,
                fullCatalogAccess: true,
                roles: ['accounting'],
                uuid: apoc.create.uuid(),
                createdAt: datetime(),
                lastModifiedAt: datetime(),
                createdBy: 'database/WAR-3480_vendor_star_access:8',
                lastModifiedBy: 'database/WAR-3480_vendor_star_access:8'
            })
            MERGE (identity)-[:HAS_PROFILE]->(profile)
            WITH profile
            MATCH (vendor:Vendor {id: '*'})
            MERGE (profile)-[:HAS_ACCESS_TO]->(vendor)
            ]]>
        </neo4j:cypher>
    </changeSet>

    <changeSet id="WAR-3480_vendor_star_access:9" author="jviletto">
        <neo4j:cypher>
            <![CDATA[
            MATCH (identity:Identity {id: '4ae1249e-e790-4cf7-ac80-edc704345167'})
            MERGE (increment:IncrementId {nodeName: 'Profile'})
                ON CREATE SET increment.id = 2
                ON MATCH SET increment.id = increment.id + 1
            CREATE (profile:Profile {
                profileId: (increment.id),
                profileType: 'MoneyhubProfile',
                profileName: identity.name,
                brand: identity.defaultBrand,
                fullCatalogAccess: true,
                roles: ['accounting'],
                uuid: apoc.create.uuid(),
                createdAt: datetime(),
                lastModifiedAt: datetime(),
                createdBy: 'database/WAR-3480_vendor_star_access:9',
                lastModifiedBy: 'database/WAR-3480_vendor_star_access:9'
            })
            MERGE (identity)-[:HAS_PROFILE]->(profile)
            WITH profile
            MATCH (vendor:Vendor {id: '*'})
            MERGE (profile)-[:HAS_ACCESS_TO]->(vendor)
            ]]>
        </neo4j:cypher>
    </changeSet>

    <changeSet id="WAR-3480_vendor_star_access:10" author="jviletto">
        <neo4j:cypher>
            <![CDATA[
            MATCH (identity:Identity {id: '9f9f2236-356c-44b2-9fb2-27e8b53192b0'})
            MERGE (increment:IncrementId {nodeName: 'Profile'})
                ON CREATE SET increment.id = 2
                ON MATCH SET increment.id = increment.id + 1
            CREATE (profile:Profile {
                profileId: (increment.id),
                profileType: 'MoneyhubProfile',
                profileName: identity.name,
                brand: identity.defaultBrand,
                fullCatalogAccess: true,
                roles: ['accounting'],
                uuid: apoc.create.uuid(),
                createdAt: datetime(),
                lastModifiedAt: datetime(),
                createdBy: 'database/WAR-3480_vendor_star_access:10',
                lastModifiedBy: 'database/WAR-3480_vendor_star_access:10'
            })
            MERGE (identity)-[:HAS_PROFILE]->(profile)
            WITH profile
            MATCH (vendor:Vendor {id: '*'})
            MERGE (profile)-[:HAS_ACCESS_TO]->(vendor)
            ]]>
        </neo4j:cypher>
    </changeSet>

    <changeSet id="WAR-3480_vendor_star_access:11" author="jviletto">
        <neo4j:cypher>
            <![CDATA[
            MATCH (identity:Identity {id: 'aaf68714-2f4d-4565-8bfa-66cebc7e7887'})
            MERGE (increment:IncrementId {nodeName: 'Profile'})
                ON CREATE SET increment.id = 2
                ON MATCH SET increment.id = increment.id + 1
            CREATE (profile:Profile {
                profileId: (increment.id),
                profileType: 'MoneyhubProfile',
                profileName: identity.name,
                brand: identity.defaultBrand,
                fullCatalogAccess: true,
                roles: ['accounting'],
                uuid: apoc.create.uuid(),
                createdAt: datetime(),
                lastModifiedAt: datetime(),
                createdBy: 'database/WAR-3480_vendor_star_access:11',
                lastModifiedBy: 'database/WAR-3480_vendor_star_access:11'
            })
            MERGE (identity)-[:HAS_PROFILE]->(profile)
            WITH profile
            MATCH (vendor:Vendor {id: '*'})
            MERGE (profile)-[:HAS_ACCESS_TO]->(vendor)
            ]]>
        </neo4j:cypher>
    </changeSet>

    <changeSet id="WAR-3480_vendor_star_access:12" author="jviletto">
        <neo4j:cypher>
            <![CDATA[
            MATCH (identity:Identity {id: 'e463e8cc-ea92-482c-bb53-94537aaa6ba8'})
                -[:HAS_PROFILE]->(profile:Profile {profileType: 'MoneyhubProfile'}),
                (vendor:Vendor {id: '*'})
            MERGE (profile)-[:HAS_ACCESS_TO]->(vendor)
            SET profile.lastModifiedAt = datetime(),
                profile.lastModifiedBy = 'database/WAR-3480_vendor_star_access:12';
            ]]>
        </neo4j:cypher>
    </changeSet>

    <changeSet id="WAR-3480_vendor_star_access:13" author="jviletto">
        <neo4j:cypher>
            <![CDATA[
            MATCH (identity:Identity {id: '3e688b2f-5907-466c-ae96-7e6d1c251c1e'})
                -[:HAS_PROFILE]->(profile:Profile {profileType: 'MoneyhubProfile'}),
                (vendor:Vendor {id: '*'})
            MERGE (profile)-[:HAS_ACCESS_TO]->(vendor)
            SET profile.lastModifiedAt = datetime(),
                profile.lastModifiedBy = 'database/WAR-3480_vendor_star_access:13';
            ]]>
        </neo4j:cypher>
    </changeSet>

    <changeSet id="WAR-3480_vendor_star_access:14" author="jviletto">
        <neo4j:cypher>
            <![CDATA[
            MATCH (identity:Identity {id: 'e157f117-8796-42ca-8eb9-9338801d0d38'})
                -[:HAS_PROFILE]->(profile:Profile {profileType: 'MoneyhubProfile'}),
                (vendor:Vendor {id: '*'})
            MERGE (profile)-[:HAS_ACCESS_TO]->(vendor)
            SET profile.lastModifiedAt = datetime(),
                profile.lastModifiedBy = 'database/WAR-3480_vendor_star_access:14';
            ]]>
        </neo4j:cypher>
    </changeSet>

    <changeSet id="WAR-3480_vendor_star_access:15" author="jviletto">
        <neo4j:cypher>
            <![CDATA[
            MATCH (identity:Identity {id: 'e49e65bf-b437-4c51-8b48-07a653f0ce55'})
                -[:HAS_PROFILE]->(profile:Profile {profileType: 'MoneyhubProfile'}),
                (vendor:Vendor {id: '*'})
            MERGE (profile)-[:HAS_ACCESS_TO]->(vendor)
            SET profile.lastModifiedAt = datetime(),
                profile.lastModifiedBy = 'database/WAR-3480_vendor_star_access:15';
            ]]>
        </neo4j:cypher>
    </changeSet>

</databaseChangeLog>
