liquibase - 有没有办法在变更集中定义局部变量?(不是变更日志级别属性)
问题描述
我有一个Liquibase变更集,它执行PostGIS可执行命令,以便将shapefile(GIS 文件)转换为表格。
<!-- Will execute :
export PGPASSWORD=postgres
shp2pgsql
-s 4326 -I /data/comptes-france/territoire/2016/communes.shp
public.communes_2016 | psql -d comptesfrance -U postgres -h localhost
-->
<changeSet id="shp2pgsql_communes_2016" author="mlebihan" failOnError="false">
<comment>Importation des shapefiles des contours des communes 2016</comment>
<executeCommand executable="export">
<arg value="PGPASSWORD=postgres"/>
</executeCommand>
<executeCommand executable="shp2pgsql">
<arg value="-s"/>
<arg value="4326"/>
<arg value="-I"/>
<arg value="/data/comptes-france/territoire/2016/communes.shp
public.communes_2016"/>
<arg value="|"/>
<arg value="psql"/>
<arg value="-d"/>
<arg value="comptesfrance"/>
<arg value="-U"/>
<arg value="postgres"/>
<arg value="-h"/>
<arg value="localhost"/>
</executeCommand>
</changeSet>
正如你所读的,它提到了很多2016
年。
- 在其
<comment>
. - 在 中
data/comptes-france/territoire/2016/communes.shp public.communes_2016
,它出现了两次。
有没有办法在变更集中声明一个局部变量,以便我可以使用 a$year
或其他东西,以避免2016
到处重复?
这个变量必须只对那个变更集是本地的,因为下一个变更集会愿意做同样的事情,但是 for2017
等等,(也许,在后面的问题中,我会问你执行for循环的能力,如果这个问题得到肯定的回答)。
解决方案
推荐阅读
- go - 使用多个小部件制作小部件
- function - 一个简单的 React 组件中的无限循环
- python - 如何将 cookie 从烧瓶设置为 reactjs
- android - 离子构建错误:构建 APK(s):构建 APK 时出错。您可以在“消息”视图中找到错误。?
- python - 无法在 Folium 中使用“分组”数据
- c - 如果数字长于 5 位,则确定数字是奇数还是偶数的程序会显示错误的输出
- c# - 如何在统一自定义编辑器中从一组可编写脚本的对象中获取值?
- jestjs - 使用函数模拟许多模块
- android - 如何在 Android CameraX 中使用 USB 摄像头
- javascript - 如何在fabric js中创建一个大但分辨率低的画布?