Liquibase diifChangeLog Command

I need the data as well as the schema differences between the 2 databases, so that I can get a changelog corresponding to the difference and then deploy it to my other version,
but the diff command seems to generate only the schema changes and not the data, how do I get the data changes as well, Simply generating a change Log and then updating results in error since it says table already exists, and thus changes aren’t entertained…

Hi @Dikshakapoor

Yes, the diff command will help you get following :

  • Finding missing objects between one database and another
  • Seeing that a change was made to your database
  • Finding unexpected items in your database

You won’t be able to get the difference in data using diff command.
Liquibase doesn’t allow you to diff the data between two databases. However you can generate the changelog only for the data in the database.

That’s right. May be try generating changelog only for the data. But again if some data already exists in the tables, it might throw an error again.

Still just in case needed, you can generate changelog for your DB data using :

liquibase --changeLogFile=generateChange.xml --diffTypes=data generateChangeLog

You can again use multiple options of generateChangeLog command for including data from schemas.

Thanks!
Rakhi Agrawal