<?xml version="1.0" encoding="UTF-8"?>
<changelog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.liquigraph.org/schema/1.0/liquigraph.xsd">
    <changeset id="DATA-8923_delete_modified_at:1" author="veixar" run-on-change="true">
        <query>
            <![CDATA[
                CALL apoc.periodic.iterate(
                    "
                        MATCH (n:GlobalParticipant)
                        RETURN n
                    ",
                    "
                        SET
                            n.lastModifiedAt = COALESCE(n.lastModifiedAt, n.modifiedAt),
                            n.modifiedAt = NULL
                    ",
                    {batchSize:1000, iterateList:true, parallel:true, concurrency: 5}
                )
                YIELD total, failedOperations, errorMessages
                CALL apoc.util.validate(failedOperations > 0, "At least one sub-operation failed: %s", [reduce(all_errors = "", error IN keys(errorMessages) | all_errors + ", " + error)])
                RETURN total;
            ]]>
        </query>
    </changeset>
    <changeset id="DATA-8923_delete_modified_at:2" author="veixar" run-on-change="true">
        <query>
            <![CDATA[
                CALL apoc.periodic.iterate(
                    "
                        MATCH (n:GlobalSoundRecording)
                        RETURN n
                    ",
                    "
                        SET
                            n.lastModifiedAt = COALESCE(n.lastModifiedAt, n.modifiedAt),
                            n.modifiedAt = NULL
                    ",
                    {batchSize:1000, iterateList:true, parallel:true, concurrency: 5}
                )
                YIELD total, failedOperations, errorMessages
                CALL apoc.util.validate(failedOperations > 0, "At least one sub-operation failed: %s", [reduce(all_errors = "", error IN keys(errorMessages) | all_errors + ", " + error)])
                RETURN total;
            ]]>
        </query>
    </changeset>
    <changeset id="DATA-8923_delete_modified_at:3" author="veixar" run-on-change="true">
        <query>
            <![CDATA[
                CALL apoc.periodic.iterate(
                    "
                        MATCH (n:PublicParticipant)
                        RETURN n
                    ",
                    "
                        SET
                            n.lastModifiedAt = COALESCE(n.lastModifiedAt, n.modifiedAt),
                            n.modifiedAt = NULL
                    ",
                    {batchSize:1000, iterateList:true, parallel:true, concurrency: 5}
                )
                YIELD total, failedOperations, errorMessages
                CALL apoc.util.validate(failedOperations > 0, "At least one sub-operation failed: %s", [reduce(all_errors = "", error IN keys(errorMessages) | all_errors + ", " + error)])
                RETURN total;
            ]]>
        </query>
    </changeset>
    <changeset id="DATA-8923_delete_modified_at:4" author="veixar" run-on-change="true">
        <query>
            <![CDATA[
                CALL apoc.periodic.iterate(
                    "
                        MATCH (n:PublicSoundRecording)
                        RETURN n
                    ",
                    "
                        SET
                            n.lastModifiedAt = COALESCE(n.lastModifiedAt, n.modifiedAt),
                            n.modifiedAt = NULL
                    ",
                    {batchSize:1000, iterateList:true, parallel:true, concurrency: 5}
                )
                YIELD total, failedOperations, errorMessages
                CALL apoc.util.validate(failedOperations > 0, "At least one sub-operation failed: %s", [reduce(all_errors = "", error IN keys(errorMessages) | all_errors + ", " + error)])
                RETURN total;
            ]]>
        </query>
    </changeset>
    <changeset id="DATA-8923_delete_modified_at:5" author="veixar" run-on-change="true">
        <query>
            <![CDATA[
                CALL apoc.periodic.iterate(
                    "
                        MATCH (n:PublicTrack)
                        RETURN n
                    ",
                    "
                        SET
                            n.lastModifiedAt = COALESCE(n.lastModifiedAt, n.modifiedAt),
                            n.modifiedAt = NULL
                    ",
                    {batchSize:1000, iterateList:true, parallel:true, concurrency: 5}
                )
                YIELD total, failedOperations, errorMessages
                CALL apoc.util.validate(failedOperations > 0, "At least one sub-operation failed: %s", [reduce(all_errors = "", error IN keys(errorMessages) | all_errors + ", " + error)])
                RETURN total;
            ]]>
        </query>
    </changeset>
    <changeset id="DATA-8923_delete_modified_at:6" author="veixar" run-on-change="true">
        <query>
            <![CDATA[
                CALL apoc.periodic.iterate(
                    "
                        MATCH (n:PublicProduct)
                        RETURN n
                    ",
                    "
                        SET
                            n.lastModifiedAt = COALESCE(n.lastModifiedAt, n.modifiedAt),
                            n.modifiedAt = NULL
                    ",
                    {batchSize:1000, iterateList:true, parallel:true, concurrency: 5}
                )
                YIELD total, failedOperations, errorMessages
                CALL apoc.util.validate(failedOperations > 0, "At least one sub-operation failed: %s", [reduce(all_errors = "", error IN keys(errorMessages) | all_errors + ", " + error)])
                RETURN total;
            ]]>
        </query>
    </changeset>
    <changeset id="DATA-8923_delete_modified_at:7" author="veixar" run-on-change="true">
        <query>
            <![CDATA[
                CALL apoc.periodic.iterate(
                    "
                        MATCH (n:PublicLabel)
                        RETURN n
                    ",
                    "
                        SET
                            n.lastModifiedAt = COALESCE(n.lastModifiedAt, n.modifiedAt),
                            n.modifiedAt = NULL
                    ",
                    {batchSize:1000, iterateList:true, parallel:true, concurrency: 5}
                )
                YIELD total, failedOperations, errorMessages
                CALL apoc.util.validate(failedOperations > 0, "At least one sub-operation failed: %s", [reduce(all_errors = "", error IN keys(errorMessages) | all_errors + ", " + error)])
                RETURN total;
            ]]>
        </query>
    </changeset>
    <changeset id="DATA-8923_delete_modified_at:8" author="veixar" run-on-change="true">
        <query>
            <![CDATA[
                CALL apoc.periodic.iterate(
                    "
                        MATCH (n:Chart)
                        RETURN n
                    ",
                    "
                        SET
                            n.lastModifiedAt = COALESCE(n.lastModifiedAt, n.modifiedAt),
                            n.modifiedAt = NULL
                    ",
                    {batchSize:1000, iterateList:true, parallel:true, concurrency: 5}
                )
                YIELD total, failedOperations, errorMessages
                CALL apoc.util.validate(failedOperations > 0, "At least one sub-operation failed: %s", [reduce(all_errors = "", error IN keys(errorMessages) | all_errors + ", " + error)])
                RETURN total;
            ]]>
        </query>
    </changeset>
    <changeset id="DATA-8923_delete_modified_at:9" author="veixar" run-on-change="true">
        <query>
            <![CDATA[
                CALL apoc.periodic.iterate(
                    "
                        MATCH (n:PublicSocialAccount)
                        RETURN n
                    ",
                    "
                        SET
                            n.lastModifiedAt = COALESCE(n.lastModifiedAt, n.modifiedAt),
                            n.modifiedAt = NULL
                    ",
                    {batchSize:1000, iterateList:true, parallel:true, concurrency: 5}
                )
                YIELD total, failedOperations, errorMessages
                CALL apoc.util.validate(failedOperations > 0, "At least one sub-operation failed: %s", [reduce(all_errors = "", error IN keys(errorMessages) | all_errors + ", " + error)])
                RETURN total;
            ]]>
        </query>
    </changeset>
</changelog>
