<?xml version="1.0" encoding="UTF-8"?>
<changelog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="file:/var/app/InputFileSchema.xsd">
    <changeset id="PLATFORM-4437_settings_up_users_with_es_locale:1" author="tnozhkina" run-always="true">
        <precondition>
            <sqlquery>
                <![CDATA[
                    SELECT EMAIL, LANGUAGE
                    FROM DEV_ENGINEERING.TNOZHKINA.ALTAFONTE_LOCALIZATION;
                ]]>
            </sqlquery>
        </precondition>
        <cypherquery>
            <![CDATA[
                CALL apoc.periodic.iterate(
                'MATCH (i:Identity) WHERE i.email=$event.EMAIL RETURN i',
                'SET i.localization=$event.LANGUAGE, i.updatedBy = "database/PLATFORM-4437_settings_up_users_with_es_locale", i.updatedOn = datetime()',
                {batchSize:1000, iterateList:true, parallel:true, params: {event: event}}
                )
                YIELD total
                RETURN total
            ]]>
        </cypherquery>
    </changeset>
</changelog>
