-
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
CORE-1127: Filter by context when doing a rollback. #898
CORE-1127: Filter by context when doing a rollback. #898
Conversation
Hi @berryh , Sorry for the wait. There appears to be conflicts that need to be resolved, would you mind doing that. After which I can pull this into Conditioning targeting a 4.0 Beta 2 release. |
@berryh while you are working on the conflict, we could use your help in writing tests, which in turn would help get this PR merged in faster. Here is the canned response I have been sending out now that our PR process has been jump started, it contains some good guidance on tests: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. |
…ontext # Conflicts: # liquibase-core/src/main/java/liquibase/changelog/AbstractChangeLogHistoryService.java # liquibase-core/src/main/java/liquibase/changelog/ChangeLogIterator.java # liquibase-core/src/main/java/liquibase/changelog/ChangeSet.java # liquibase-core/src/main/java/liquibase/changelog/DatabaseChangeLog.java
…thub.com:berryh/liquibase into feature/CORE-1127-fix-wrong-rollback-for-context
Hi all, sorry for the long silence! Nice to see this PR progressing, if there's still anything you need from me, please let me know! |
Hi @berryh , after ro-rah comment in 2020 I thought you went MIA. I merged master to your branch and added some integration tests, if you want to take a look and see if it's all fine for you let me know. |
Fair enough, nice work! I remember seeing the comment and saying that I'd have to take a look at it later, but never got around to it. Nice to see this being picked up! |
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.
This PR addresses a long-standing bug where Liquibase rollback commands ignore some <rollback>
changes because Liquibase was not applying contexts during rollback.
- New integration test added to validate rollback by count uses contexts when contexts matching changeset-specified context are provided.
- New integration test added to validate rollback by count is successful when no contexts are provided and the changesets themselves do not specify a context.
- Functional and test harness automation suites passing.
- No additional testing required.
APPROVED
[X] BUG
When a changelog file contains two changesets with same author and id but with different contexts, only the first changeset has its rollback block applied when rolling back. Liquibase will always choose the first changeset without taking the context into account. See the issue for an example of this behaviour. This pull request is an option to fix this, by filtering on context before actually doing the rollback.
It adds unit tests to make sure it run correctly.
JIRA Issue: CORE-1127