我实际上在Windows的命令行中使用Liquibase,并尝试创建一个表示两个数据库之间差异的SQL脚本。不幸的是,我只得到了XML文件作为返回结果。你能帮我吗?
我的命令行:
liquidbase.bat
--driver=com.mysql.jdbc.Driver
--url=jdbc:mysql://localhost:3306/base1
--username=root
diffChangeLog
--referenceUrl=jdbc:mysql://localhost:3306/base2
--referenceUsername=root
> test.sql
我在另一个论坛上看到了类似的问题,但他没有得到好的答案(http://forum.liquibase.org/topic/convert-changelog-xml-file-into-sql-file)。 我也看过一些从updateSQL cmd获得sql文件的参数,但从未看到过diffChangeLog的参数。
XML反馈的示例:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<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-2.0.xsd">
<changeSet author="user (generated)" id="1370443156612-1">
<createTable tableName="test">
<column name="a" type="INT"/>
</createTable>
</changeSet>
<changeSet author="user (generated)" id="1370443156612-2">
<addColumn tableName="articles">
<column name="date_debut" type="TEXT">
<constraints nullable="false"/>
</column>
</addColumn>
</changeSet>
Thanks by advance.