How to handle database migrations in Spring Boot with Hibernate?

Liquibase or Flyway are the two main options for versioning/handling database migrations. ddl-auto is quick and dirty, but it does not, nor can it, take into account everything that needs to be handled. THere’s also the chance of race-conditions (two instances trying to update the DDL at the same time).

This answer goes into more detail about ddl-auto in a production environment, and why you shouldn’t.

Hibernate: hbm2ddl.auto=update in production?

https://www.credera.com/blog/technology-insights/java/liquibase-fed-inconsistent-schemas/ has bit more info on the why/concepts.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)