Versioning and upgrading database schema
As our applications evolve, we’ll need to keep the database in sync with our Java entities. That could be a complex and error prone task. To address this scenario, there are tools to manage database schemas and database migrations. A couple of examples of such tools are Flyway and Liquibase, both supported by Spring Boot.
In addition to the database migration feature itself, Flyway provides the following features:
- Version control to keep track of the migrations applied to a database and the ones which are pending.
- It can be integrated into development environments and build automation tools, such as Maven or Gradle.
- Repeatable migrations. Every time Flyway runs, repeatable migrations are executed ensuring that the database remains in the desired state.
- Rollback and undo operations. Flyway can automatically generate SQL scripts to undo a specific migration, allowing rollbacks in case of issues.
- It can execute...