liquibase - Liquibase 使用 maven 生成具有多个模式的 generateChangeLog
问题描述
在我的项目中,我们希望使用 liquibase 为我们正在使用的多个模式生成 sql。我已经用单个模式配置了 maven 插件,它工作正常,但是当我尝试配置具有执行的多个模式时,它不起作用。我通过创建不同的配置文件和该配置文件的特定目标来尝试它,它可以工作文件,但我希望它在单个目标中运行,所有模式具有特定于每个模式的不同更改日志。
下面是我用于单一模式的配置
<plugin>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-maven-plugin</artifactId>
<version>3.4.1</version>
<configuration>
<propertyFile>${project.build.directory}/unpack/liquibase.properties</propertyFile>
<outputChangeLogFile>${project.build.directory}/liquibase-outputChangeLog.xml</outputChangeLogFile>
<changeLogFile>${project.build.directory}/liquibase-outputChangeLog.xml</changeLogFile>
<diffTypes>tables, views, columns, indexes, foreignkeys, primarykeys, uniqueconstraints, data</diffTypes>
</configuration>
<dependencies>
<dependency>
<groupId>org.liquibase.ext</groupId>
<artifactId>liquibase-hibernate4</artifactId>
<version>3.5</version>
</dependency>
<!-- ojdbc6.jar example -->
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.2.0.1</version>
</dependency>
<!-- ojdbc7.jar example -->
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc7</artifactId>
<version>12.1.0.2</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>generate-change-log</id>
<phase>generate-resources</phase>
<goals>
<goal>generateChangeLog</goal>
</goals>
</execution>
<execution>
<id>sync-sql-log</id>
<phase>process-resources</phase>
<goals>
<goal>changelogSync</goal>
</goals>
</execution>
<execution>
<id>generate-sql-log</id>
<phase>generate-resources</phase>
<goals>
<goal>updateSQL</goal>
</goals>
</execution>
</executions>
</plugin>
解决方案
推荐阅读
- c# - Crystal Reports 试图从 2 个表中进行选择
- java - 如何接受和执行任意 Java 代码
- c# - ASP.NET HTML - 文本框非常靠近,需要帮助在它们之间放置空间
- cordova - 使用 Cordova 脚本创建 .ipa 文件
- umbraco - Umbraco 7.4 URL 重定向功能
- typescript - X 类型的参数不能分配给 Y 类型的参数(尽管有继承)
- regex - 结构替换可能复杂的 RegexReplace 解决方案?
- r - 使用 lme4 自定义引导置信区间
- sql-server - SQL Server 中的正则表达式 - 连字符分隔的字符串
- javascript - javascript 将函数对象传递给网络工作者 - 无法克隆错误 DataCloneError