首页 > 解决方案 > 在 Spring Boot 微服务中回滚 liquibase 的便捷方式

问题描述

我们将 liquibase 用于我们的 springboot 微服务中使用的数据库。

我们的 SRE 团队被迫维护多个版本,并在不同版本之间来回切换。此外,他们无法在生产环境中访问 maven 或 liquibase cli。

我们正在寻找无缝回滚和升级,但到目前为止还没有运气。任何建议都受到高度赞赏。

标签: springpostgresqlmavenspring-bootliquibase

解决方案


Take a look at liqubiase database tags.

With them you'll be able to capture data model versions you need.

Then take a look at liquibase rollback to tag functionality.

With that you'll be able to roll back to certain stages of your data model.

Since your SRE team doesn't have access to maven or liqubiase, perhaps you'll be able to choose what liqbuiase changeSets to execute with your application properties or perhaps with liquibase context,

UPDATE

You can also use rollback by changeSetId or changeSetAuthor e.g.:

<changeSet id="foo" author="bar">
    <rollback changeSetId="ID" changeSetAuthor="AUTHOR"/>
</changeSet>

推荐阅读