<?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="PUB-79_backfill_pub_song_id:1" author="larmstead">
        <query>
            MATCH (c:PublishingComposition) WHERE c.pubSongID is not null
                WITH max(c.pubSongID) as maxID
                    MERGE (i:IncrementId {nodeName: "PubSongIDCounter"})
                        ON CREATE SET i.id = maxID + 1
        </query>
    </changeset>

    <changeset id="PUB-79_backfill_pub_song_id:2" author="larmstead">
        <query>
            MATCH (c:PublishingComposition)
            WHERE c.pubSongID is null
                MERGE (i:IncrementId {nodeName: "PubSongIDCounter"})
                    ON MATCH SET i.id = i.id + 1
            SET c.pubSongID = i.id
        </query>
    </changeset>
</changelog>
