<?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="TAP-2699_grant_access_for_knr_accounts:1" author="amerkulov">
        <neo4j:cypher>
            MATCH (n:Identity)-[:HAS_PROFILE]->(profile:Profile { profileType:'DocumentsProfile' })
            WHERE n.email IN ["fin.clowe@kollectivenr.com"]
            MATCH (cb:CompanyBrand {name: "knr"})-[:HAS_LABEL]->(vendor:Vendor)
            WHERE vendor.vendorId IN [793801, 793938]
            MERGE (profile)-[:HAS_ACCESS_TO]->(vendor)
            RETURN profile, vendor;
        </neo4j:cypher>
    </changeSet>
</databaseChangeLog>
