我实际上在命令行窗口上使用Liquibase,我尝试创build一个代表两个数据库之间的差异的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反馈示例:
使用PHP / node / python脚本的START / B无法按预期工作
mklink权限在Windows 8上
Windows命令“哪里arg”在XP?
唯一的,持久的networking设备信息
如何在Windows上使用PHP运行这些Unixtypes的命令
<?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>
感谢提前。
如何使脚本仍在运行时shell输出redirect(>)写入?
使用man命令描述我的文件
Vim:从vim命令运行java会产生错误
在shell命令后删除换行符
你正在运行diffChangeLog命令,我想你想diff命令? 请参阅手册中的 输出模式 。
liquibase.bat --driver=com.MysqL.jdbc.Driver --url=jdbc:MysqL://localhost:3306/base1 --username=root --referenceUrl=jdbc:MysqL://localhost:3306/base2 --referenceUsername=root diff > test.sql
diff命令只提供文本概述的差异。
使用diffChangeLog (暂时也许)通过比较两个数据库来更新您的更改日志
使用updatesql针对过时的数据库来显示将运行的sql命令以使其更新。 注意打印的sql也将包含liquibase管理所需的命令。
然后,如果新的/ dev数据库是您所期望的,则可以使用您的代码提交新的更新日志。 使用changelogSync使新的/ dev数据库认为它已被liquibase更新。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。