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

SpringBoot Liquibase Support of rollback automatically #41264

Closed
abhiptl opened this issue Jun 28, 2024 · 1 comment
Closed

SpringBoot Liquibase Support of rollback automatically #41264

abhiptl opened this issue Jun 28, 2024 · 1 comment

Comments

@abhiptl
Copy link

abhiptl commented Jun 28, 2024

We have a Spring boot application with liquibase configuration to apply database change sets. When we deploy the application(1.0.1) then it automatically applies change sets in the database. But, if I want to roll back the application to the previous version(1.0.0) and when we deploy the previous version(1.0.0), Spring Boot cannot roll back database changes that were applied during the 1.0.1 deployment.

I found spring.liquibase.tag and spring.liquibase.rollback-file but these options are not helping much as it just generates the rollback-file of the deployed version which I have to use later on for rollback. Also, spring.liquibase.rollback-file generates files only when we deploy the application. Now, the application is deployed in some containerized platform(Openshift or Kubernetes), and it is difficult to get that generated rollback file.

Ideally, when we deploy the previous version(1.0.0), spring boot liquibase should automatically revert all the database changes made after 1.0.0(which 1.0.1 in this case)

If this feature is already available, can you point that to me? Or can we implement this feature?

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jun 28, 2024
@wilkinsona
Copy link
Member

Spring Boot's limited to the API that's provided by Liquibase's SpringLiquibase class and it does not provide an API to do what you've described. Support for the Customizer functionality in SpringLiquibase is coming in Spring Boot 3.4 and you may be able to use that to work with the lower-level Liquibase API.

Beyond the above, I don't think there's much more we can do here as we're not Liquibase experts. I think your question would be better aimed at the Liquibase community. You may be able to use one of the various rollback methods on Liquibase to do what you want but they will be able to offer better guidance. If, once you've learned that it is possible to do what you want with the Liquibase API, please circle back here if you think Spring Boot could do something to make it easier and we can re-open the issue and take another look.

@wilkinsona wilkinsona closed this as not planned Won't fix, can't repro, duplicate, stale Jun 28, 2024
@wilkinsona wilkinsona removed the status: waiting-for-triage An issue we've not yet triaged label Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants