Skip to content
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

Implement autorollback for <empty/> and <output/> changes #4103

Conversation

jccampanero
Copy link
Contributor

Impact

  • Bug fix (non-breaking change which fixes expected existing functionality)
  • Enhancement/New feature (adds functionality without impacting existing logic)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

Currently, trying to rollback a changeset with either an <empty /> or <output /> change, is unsupported, the library raises liquibase.exception.RollbackImpossibleException.

Due to the nature of both type of changes Liquibase must support auto rollback for them.

This PR address the issue by providing a convenient implementation of the AbstractChange's createInverses method.

Fixes #4095.

Things to be aware of

Nothing.

Things to worry about

Nothing.

Additional Context

N/A.

@nvoxland
Copy link
Contributor

Initial review:

Changes look right, thanks @jccampanero!

Things to be aware of:

  • Nothing

Things to worry about:

  • Nothing

@jccampanero
Copy link
Contributor Author

You are welcome @nvoxland. My pleasure to help.

@MalloD12 MalloD12 self-assigned this May 3, 2023
@MalloD12 MalloD12 added sprint2023-50 SafeToBuild Indicates that a particular PR contains changes which are safe to build using GitHub actions labels May 3, 2023
@jccampanero
Copy link
Contributor Author

Thank you very much for providing the tests cases and updating the branch @MalloD12 Daniel.

@MalloD12 MalloD12 self-requested a review May 4, 2023 18:15
Copy link
Contributor

@MalloD12 MalloD12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved.

Review and testing results:

Thank you, @jccampanero for your changes. They look good to me. Below what I have done:

  • Manual test performed: deploy empty and output changes, and them performed rollback to both of them successfully.
  • Add change sets to our rollback integration tests, and they have been executed successfully.

Things to be aware of:

  • None

Things to worry about:

  • None

@MalloD12
Copy link
Contributor

MalloD12 commented May 4, 2023

@AMBERMW13 - @adrian-velonis1 (cc: @mariochampion ) it would be nice if we can update our documentation to reflect these changes. I have created PD-3365 for it.

Thanks,
Daniel.

@jccampanero
Copy link
Contributor Author

Approved.

Review and testing results:

Thank you, @jccampanero for your changes. They look good to me. Below what I have done:

  • Manual test performed: deploy empty and output changes, and them performed rollback to both of them successfully.
  • Add change sets to our rollback integration tests, and they have been executed successfully.

Things to be aware of:

  • None

Things to worry about:

  • None

Thank you very much Daniel.

Copy link
Contributor

@XDelphiGrl XDelphiGrl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR implements the auto-rollback functionality for empty and output change types. Rollback operations involving empty or output change types will no longer throw the "no inverse" error dreaded by all who love Liquibase.

  • New unit tests added.
  • Functional and test harness executions passing.
  • No additional testing necessary.

APPROVED

@filipelautert filipelautert merged commit 90cf3ee into liquibase:master May 16, 2023
9 of 10 checks passed
@filipelautert filipelautert added this to the 1NEXT milestone May 16, 2023
@jccampanero jccampanero deleted the 4095_implement_autorollback_for_empty_and_output branch May 18, 2023 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
SafeToBuild Indicates that a particular PR contains changes which are safe to build using GitHub actions sprint2023-50 TypeEnhancement
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Feature request: implement autorollback for change types: <empty/> and <output/>
6 participants