Liquibase compare diffs

So I think a great feature to add to liquibase would be a sort of comparative diff feature. Let me explain.

Going through the dev process, there are tons of changes made to the database, some might be undoing changes that were made by someone else. But when it comes to releasing a product, all you care about is the state of the database at the time of release. For example,

Releasing v1.0 liquibase generateDiff-> generates change logs for 1.0

Add columns c1 and c3

Rename c3 to c2

Releasing v1.1 liquibase generateDiff against 1.0 -> generate changelogs for 1.1 comparing to 1.0 so it’d just be add columns c1 and c2

It’d just make everything a look better when releasing a product and I think it’d make reading the changelogs significantly easier.


My apologies. It seems this feature exists, I must’ve missed it somehow! (egg on face)

It does exist, but I generally think of it as more of a sanity check than something to rely on. The diff tool does not check everything (such as data type sizes or stored procedure text) and so if you rely on a diff you may miss important changes.

I also think that testing throughout the process has been done on the step-by-step updates that occurred during development, and so changing the database upgrade path at the end would require considerable re-testing for not a lot of gain. There may be some less-than-ideal transformations in the upgrade process, but unless there are some very expensive and unnecessary changes, I generally prefer to leave them as they are rather than have to retest. Just my opinion, though.