Liquibase包含上下文 [英] Liquibase include with context

查看:70
本文介绍了Liquibase包含上下文的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在databaseChangeLog中包括文件,但是这些文件可能不存在,具体取决于安装情况. 我的想法是在上下文中使用诸如include之类的东西,因此Liquibase仅在给出适当的上下文时才尝试打开文件:

I need to include files in a databaseChangeLog, but these files may not exist, depending on the installation. My idea was to use something like includes with context, so Liquibase will only try to open the file when the appropriate context is given:

<include file="myFile" context="myContext"/>

但是include标记中未使用上下文,并且Liquibase失败,因为该文件不存在. 我宁愿不使用includeAll,因为我需要将文件包含在主文件的特定部分中. 有任何想法吗?谢谢!

But context is not used in an include tag, and Liquibase fails because the file is not present. I’ll rather not use includeAll because I need the files to be included at specific parts of my main file. Any ideas? Thanks!

推荐答案

您正在使用哪个版本的liquibase?

Which version of liquibase are you using?

上下文"已添加到此

The "context" was added to the include tag in this commit.

也请查看这张吉拉机票: CORE-155 .

Also check out this jira ticket: CORE-155.

那么也许您的liquibase版本太旧(低于3.5.0)?

So maybe your version of liquibase is just too old (below 3.5.0)?

这篇关于Liquibase包含上下文的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆