【发布时间】:2014-08-25 16:46:05
【问题描述】:
我想用Java在liquibase中生成一个变更日志XML文件,里面存储了两个数据库差异的信息。
我的代码是:
Database database=CommandLineUtils.createDatabaseObject(MySQLConnection.class.getClassLoader(),
"jdbc:mysql://localhost:3306/test", "root", "admin", "com.mysql.jdbc.Driver", "", null,false,false,null,null,null,null);
Database database2=CommandLineUtils.createDatabaseObject(MySQLConnection.class.getClassLoader(),
"jdbc:mysql://localhost:3306/pizzashop", "root", "admin", "com.mysql.jdbc.Driver", "", null,false,false,null,null,null,null);
CommandLineUtils.doDiffToChangeLog("changelog.xml", database2, database,new DiffOutputControl(),null,null);
但它会生成一个空白的changelog.xml 文件。
【问题讨论】:
-
现在,上面的脚本中有一个错字,将输出发送到“chagelog.xml”而不是“changelog.xml”,但这可能只是一个错字。
-
我改了代码,结果还是一样
-
能否在 liquibase 属性文件中设置 logLevel=DEBUG,然后附加日志?