0
如标题所示,我想使用Liquibase在脱机模式下为空数据库生成更改日志。我的Ant文件如下所示:使用Liquibase在离线模式下为空数据库生成更改日志
<project xmlns:liquibase="antlib:liquibase.integration.ant">
<taskdef resource="liquibase/integration/ant/antlib.xml" uri="antlib:liquibase.integration.ant">
<classpath>
<pathelement location="antlibs/liquibase-core-3.5.3.jar" />
<pathelement location="antlibs/snakeyaml-1.18.jar" />
</classpath>
</taskdef>
<target name="generate-changelog">
<liquibase:generateChangeLog>
<liquibase:database url="offline:postgresql?snapshot=snapshot.json" />
<liquibase:xml outputfile="target/changelog.xml" encoding="UTF-8" />
</liquibase:generateChangeLog>
</target>
后来我想补充Liquibase-Hibernate4来从我的实体的更新日志,但我之前遇到的各种问题。如果我简单地使用url“offline:postgresql”,则由于Liquibase试图克隆不可用的快照,因此ant任务会崩溃并出现NullPointerException。如果我添加“?snapshot = snapshot.json”,Liquibase(或Yaml)无法找到我的文件。
我的问题:
- 这时候我只是想,没有任何基础的快照都创建我的实体changelog的正确的方法?
- 有没有更容易的方法来提供一个空的数据库liquibase作为基地?
- 如何将snapshot.json添加到项目以确保蚂蚁任务可以找到它?