liquibase icon indicating copy to clipboard operation
liquibase copied to clipboard

Tag should remain after rollback [CORE-2946]

Open philomory opened this issue 7 years ago • 5 comments

Fixes https://liquibase.jira.com/browse/CORE-2946, making behavior of liquibase more consistent and predictable - rollback to tag behavior does not depend on whether the tag is isolated in it's own changeset or not. This also mirrors the behavior of updateToTag, so that updating to a tag, and rolling back to that tag, both have identical results.

philomory avatar Jul 27 '18 21:07 philomory

@philomory Thanks for your pull request!

Here’s what happens next:

A member of the Liquibase team will take a look at your contribution and may suggest:

The PR will be prioritized according to our internal development and testing capacity.

We’ll let you know when it’s ready to move to the next step or if any changes are needed.

ro-rah avatar May 13 '20 20:05 ro-rah

Hi @philomory ,

Would you be up for adding some tests for this change? I will size at a medium for now but can drop it down to a Low to get merged in faster if I see you commit tests before we start on 4.0 Beta 2.

Thanks!

Ronak

ro-rah avatar May 13 '20 20:05 ro-rah

➤ Erzsebet Carmean commented:

@philomory, I appreciate the PR and the link back to the CORE bug ticket. I'm flagging this for internal discussion. I've not seen the behavior described in this bug and PR. This means I'll need a bit of help from Dev to make sure I've got the correct use case to set up the test.

-erz (@ XDelphiGrl)

CC: [~accountid:557058:c8f0b24d-f02f-431c-8842-fd9c929dfbf2] CC: [~accountid:5d937e71f5d3c10d8bfd351d]

liquibot avatar May 26 '20 14:05 liquibot

This is handling the case where someone has a changelog with:

<changeSet id="1" author="test">
   <tagDatabase tag="my_tag">
</changeSet>

which is a different way of tagging the database than with liquibase tag my_tag

The difference in behavior happens because liquibase tag tags the last changeSet in the database and is done, whereas the tagDatabase inside a changeSet will tag the last changeset in the database and THEN create a new datbasechangelog entry saying changeset 1::test was executed.

The difference ends up being that what is tagged is different in the two cases and people want different things. https://liquibase.jira.com/browse/CORE-2815 was opened and fixed based on one way people see it working and this PR undoes that fix based on a different use case.

We need to put a bit more thought into exactly how the tagDatabase command works and whether (or if) it should be tagging the changeSet it is in or the changeSet after or if it should be a configurable thing in the tagDatabase tag or something.

nvoxland avatar May 27 '20 19:05 nvoxland

➤ Mario Champion commented:

yes, the certainly seems worth some discussion. As we know, we need to get to a standardized and well-documented behavior for these kinds of issues. thanks for noticing it and bringing it up.

liquibot avatar May 27 '20 19:05 liquibot