-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add rollback changeset reference for SQL changelogs #1386
Add rollback changeset reference for SQL changelogs #1386
Conversation
Thanks @atzawada for creating this enhancement request. A member of the Liquibase team will take a look at your contribution and may suggest We’ll let you know when it’s ready to move to the next step or if any changes are needed. If you have any unit tests or integration tests to add that would be great. |
What is the hold up on this PR? Can I help? Because I am interested in this functionality. |
@awhitford-cip The hold up is that we are fortunate to have a high volume of community requests and are continually working on how best to address them. Some folks are also right now on much needed vacation, but we will review. |
Hi @kataggart, @awhitford-cip, completely understand the difficulty getting to this with the high volume of PRs coming in. Still willing to help get this in if there are changes that need to be made. |
…/atzawada/liquibase into atzawada-atzawada-add-changelog-reference
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code review and test results:
Things to be aware of:
- Change only impacts formatted sql (other formats already had this feature)
- Pattern match is case insensitive like it should be
- I added a unit test and some additional error handling
Things to worry about:
- Nothing
The changes look good, thanks @atzawada !
For this PR, I tested if rollback reference works with a changeset on the same changelog and with one in another changeset. Both work just fine. Theres a couple behaviors that called my atention and think is good to share and be aware about: Test Environment: |
@awhitford-cip @atzawada This is now available in 4.16 that released on Friday. |
name: Add rollback changeset reference for SQL changelogs
about: Add rollback changeset reference for SQL changelogs
title: ''
labels: Status:Discovery
assignees: ''
Environment
Liquibase Version:
Liquibase Integration & Version: <Pick one: CLI, maven, gradle, spring boot, servlet, etc.>
Liquibase Extension(s) & Version:
Database Vendor & Version:
Operating System Type & Version:
Pull Request Type
Closes #1335.
Description
Code to introduce referencing another changeset in a rollback statement in a SQL changelog file.
Current Behavior
Liquibase currently doesn't have any behavior to allow for referencing another changeset in a SQL rollback statement.
Desired Behavior
The new code would allow for this functionality, using either;
--rollback changeSetId:create-table-demo changeSetAuthor:atzawada changeSetPath:src/main/resources/testCreate.sql
if the changeset being referenced is in a different changelog file, or:
--rollback changeSetId:create-table-demo changeSetAuthor:atzawada
if the changeset is in the same changelog file.
Fast Track PR Acceptance Checklist: