我实际上在命令行的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
Run Code Online (Sandbox Code Playgroud)
我在其他论坛上看过这个类似的问题,但他没有得到一个好的答案(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>
Run Code Online (Sandbox Code Playgroud)
谢谢你提前.
我有一个使用HierarchicalDataTemplate创建的树视图,您可以在下面的代码中看到:
<TreeView ItemsSource="{Binding AllFolders}" SelectedItemChanged="TreeView_SelectedItemChanged"/>
Run Code Online (Sandbox Code Playgroud)
和
<HierarchicalDataTemplate DataType="{x:Type model:Folder}" ItemsSource="{Binding Tools}">
<StackPanel Orientation="Horizontal">
<Image Source="{StaticResource ResourceKey=icon}"/>
<TextBlock Text="{Binding Title}"/>
</StackPanel>
</HierarchicalDataTemplate>
<DataTemplate DataType="{x:Type model:Tool}">
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Name}"></TextBlock>
</StackPanel>
</DataTemplate>
Run Code Online (Sandbox Code Playgroud)
它运行良好,但现在我需要在文件夹中添加其他类型的对象,以使树视图像这样:
工具和位置必须使用不同的DataTemplate.它们都是IList包含在Folder Class(IList<Tool>和IList<Location>)中.
它甚至可以做到吗?我怎样才能做到这一点?
谢谢你的帮助