Liquibase Command Line create diff changelog in sql Liquibase Command Line create diff changelog in sql database database

Liquibase Command Line create diff changelog in sql


The diff command only provides a textual overview of the differences.

In order to get an SQL of the difference of a new (dev) and old database:

  1. Use diffChangeLog to (temporarily perhaps) update your changelog by comparing two databases

  2. Use updateSQL against the out-of-date database to show the sql commands that would be run to bring it up to date. Note the printed SQL will also contain commands needed by liquibase for administration.

You can then commit the new changelog with your code if the new/dev database is what you expect. Use changelogSync to make the new/dev database thinks it's been updated by liquibase.


You're running the diffChangeLog command, I think you want the diff command? See Output Modes in the manual.

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