Issue
I was recently switched from a project working with .Net Framework and Entity Framework to Java using Spring Boot 2 and Hibernate. When working on the .Net Framework project whenever I needed to update the database schema, for example, changing the type of a column in a table the process was simply to change the model in the data access layer and then run the migrations command to create the migration file. Then another command to apply it.
From what I have researched Flyway and Liquibase are both good options when dealing with database migrations. I have looked into Flyway and have noticed the process is very similar other than I have to create the migration myself either in sql or with java code and place it in a specific directory.
Does Java, specifically spring boot applications have a tool for database migrations that is similar to what the .Net Framework and Entity Framework provide?
Solution
To my best knowledge - no. All the projects I've been working on have used Flyway as the migration tool, and it was fine for our needs, writing most of our migrations in SQL.
Hibernate itself offers a limited possibility to migrate DB schemas based on the Java code, which is fine while used for development purposes, but I haven't heard of a team using it on production.
If you're using Spring Boot as your framework, it integrates nicely with Hibernate, Flyway and Liquibase: https://docs.spring.io/spring-boot/docs/2.3.2.RELEASE/reference/html/howto.html#howto-database-initialization
Answered By - ttarczynski