You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 3, 2023. It is now read-only.
The first time, it will record the execution with a MERGE query equivalent to:
MATCH (changelog:__LiquigraphChangelog)
CREATE (changelog)<-[:EXECUTED_WITHIN_CHANGELOG {order: 1}]-(:__LiquigraphChangeset {id: "create-node"})
(other properties of the changeset omitted). All is well.
The second time, due to the presence of the order property inside the MERGE clause, it will record another execution, despite the method being called "upsert":
MATCH (changelog:__LiquigraphChangelog)
CREATE (changelog)<-[:EXECUTED_WITHIN_CHANGELOG {order: 2}]-(:__LiquigraphChangeset {id: "create-node"})
If you try to run Liquibase a third time, it will complain that you have less declared changesets than have been executed (persisted).
I think the fix is actually simple. Instead of
MATCH (changelog:__LiquigraphChangelog)
MERGE (changelog)<-[:EXECUTED_WITHIN_CHANGELOG {order: {1}}]-(changeset:__LiquigraphChangeset {id: {2}})
ON MATCH SET changeset.checksum = {3},
changeset.query = {4}
ON CREATE SET changeset.author = {5},
changeset.query = {4}
changeset.checksum = {3}
MATCH (changelog:__LiquigraphChangelog)
MERGE (changelog)<-[exec:EXECUTED_WITHIN_CHANGELOG]-(changeset:__LiquigraphChangeset {id: {2}})
ON MATCH SET changeset.checksum = {3},
changeset.query = {4}
ON CREATE SET changeset.author = {5},
changeset.query = {4}
changeset.checksum = {3},
exec.order = {1}
(not tested at all, though, but it's the gist of the fix).
I'll try preparing a pull request.
The text was updated successfully, but these errors were encountered:
The persistence of changesets has changed since RC2, which fixed the bug
reported in liquibase#58. However, there are no tests on changesets with those
attributes, and this commit fixes that.
The persistence of changesets has changed since RC2, which fixed the bug
reported in #58. However, there are no tests on changesets with those
attributes, and this commit fixes that.
Liquigraph can only be run twice with the following changelog:
The first time, it will record the execution with a
MERGE
query equivalent to:(other properties of the changeset omitted). All is well.
The second time, due to the presence of the
order
property inside theMERGE
clause, it will record another execution, despite the method being called "upsert":If you try to run Liquibase a third time, it will complain that you have less declared changesets than have been executed (persisted).
I think the fix is actually simple. Instead of
the
CHANGESET_UPSERT
query should be(not tested at all, though, but it's the gist of the fix).
I'll try preparing a pull request.
The text was updated successfully, but these errors were encountered: