C.47 LiquibaseDiffTask

The LiquibaseDiffTask creates a diff between two databases. Will output the changes needed to convert the reference database to the state of the database.

Table C.56: Attributes

NameTypeDescriptionDefaultRequired
jarStringLocation of the Liquibase jar file.n/aYes
classpathStringAdditional classpath entries.n/aYes
changeLogFileStringLocation of the changelog file in which the changes get written or read from.n/aYes
usernameStringThe username needed to connect to the database.n/aYes
passwordStringThe password needed to connect to the database.n/aYes
urlStringThe JDBC Url representing the database datasource, e.g jdbc:mysql://localhost/mydatabasen/aYes
referenceUsernameStringThe username needed to connect to the reference database.n/aYes
referencePasswordStringThe password needed to connect to the reference database.n/aYes
referenceUrlStringThe JDBC Url representing the database reference datasource, e.g jdbc:mysql://localhost/refdatabasen/aYes
displayBooleanWhether to display the output of the command. Only used if passthru isn't true.falseNo
passthruBooleanWhether to use PHP's passthru() function instead of exec(). True by default for backwards compatibility. When true, the attributes display, outputProperty and checkReturnare ignored.trueNo
checkreturnBooleanWhether to check the return code of the execution, throws a BuildException when returncode != 0.falseNo
outputPropertyStringProperty name to set output value to from the execution. Ignored if passthru attribute is true.n/aNo

C.47.1 Example

<liquibase-diff
      jar="/usr/local/lib/liquibase/liquibase.jar"
      classpathref="/usr/local/lib/liquibase/lib/mysql-connector-java-5.1.15-bin.jar"
      changelogFile="./changelogTest.xml"
      username="liquibase"
      password="liquibase"
      url="jdbc:mysql://localhost/mydatabase"
      referenceUsername="liquibase"
      referencePassword="liquibase"
      referenceUrl="jdbc:mysql://localhost/refdatabase"
    />

C.47.2 Supported Nested Tags