<?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-2182_remove_vendor_star_access:1" author="epohrebna">
        <neo4j:cypher>
            <![CDATA[
            WITH [
                'rroy@sonymusic-pde.com',
                'atemkar+awal@theorchard.com',
                'emest+awal@sonymusic-pde.com',
                'nsnyder+awaltest@theorchard.com',
                'gmaroulis@sonymusic-pde.com',
                'emest@sonymusic-pde.com'
            ] AS emails
            MATCH (i:Identity)-[:HAS_PROFILE]->(p:Profile {profileType: 'MoneyhubProfile'})
                -[relationship:HAS_ACCESS_TO]->(v:Vendor {id: '*'})
            WHERE i.email IN emails
            DELETE relationship
            SET p.lastModifiedAt = datetime(),
                p.lastModifiedBy = 'database/WAR-2182_remove_vendor_star_access:1';
            ]]>
        </neo4j:cypher>
    </changeSet>
</databaseChangeLog>
