Even the free version of Liquibase looks powerful and offers rollback command, comparison between two databases and different file formats for migrations.
It also claims to be able to compare Spring Entities with the database and generate a migration script from the differences. I have tested it but I was not able to get it working due to something that looked like a bug on Liquibase. Also, StackOverFlow’s wisdom said that it is not a good practice.
It can be executed when Spring starts up the application, through Maven command and more.
You can check on my demo project the following:
- Migration instructions on file src/main/resources/db/changelog.xml
- Liquibase configurations on file src/main/resources/liquibase.properties
- Maven plugin for Liquibase on pom.xml
The main commands are below.
Liquibase also creates two control tables on the database where it is possible to watch the changes.