【发布时间】:2021-01-13 13:54:12
【问题描述】:
我正在使用 Liquibase 4.0.0 版在 PostgreSQL 中部署数据库迁移脚本。
我使用一个主变更日志文件,它如下所示。
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.8.xsd">
<includeAll path="4.460.7" relativeToChangelogFile="true"/>
</databaseChangeLog>
我的项目结构如下所示。
我使用docker 容器在我的 Jenkinsfile 中运行liquibase update,如下所示。
docker run --rm -v /home/jenkins/workspace/mate_DB_Migration_Scripts_master:/liquibase/changelog liquibase/liquibase --url="jdbc:postgresql://host:5432/postgres?currentSchema=schema1" --changeLogFile=../liquibase/changelog/changelog.xml --username=postgres --password=some_password update
docker run --rm -v /home/jenkins/workspace/mate_DB_Migration_Scripts_master:/liquibase/changelog liquibase/liquibase --url="jdbc:postgresql://host:5432/postgres?currentSchema=schema2" --changeLogFile=../liquibase/changelog/changelog.xml --username=postgres --password=some_password update
它运行update 就好了。问题是我可以在 databasechangelog 文件中看到 2 行,如下所示,对于相同的 changeset。
有人知道为什么会这样吗?如果您需要任何其他信息来解决此问题,请告诉我。
【问题讨论】:
标签: postgresql docker database-migration liquibase