在 Dropwizard 的数据库迁移包装器中,是否可以根据上下文进行迁移?

In Dropwizard's db migration wrapper, is it possible to migrate based on contexts?

liquibase 具有指定更改集上下文的功能。对于 xml,它位于 context=test (http://www.liquibase.org/documentation/contexts.html) 之类的标签中。 上下文的想法是,您可以让迁移仅在您指定某些上下文时应用(例如仅在 qatest 上下文中 运行 时加载此测试数据)。

我似乎无法在 Dropwizard 的 db migrate 中找到利用此功能的方法。

有人知道这是否可行吗?

简短回答...不,在深入研究后我发现 dropwizard 仅公开了 liquibase 功能的有限子集。

现在这成为可能!

使用 -i--include 指定要使用的上下文

示例:

java -jar app.jar db migrate -i myContext config.yml