Can Flyway or Liquibase generate an update script instead of updating the database directly?

前端 未结 5 1062
难免孤独
难免孤独 2020-12-31 04:14

First, a little background. I have a set of Java applications, some based on JPA, some not. To create my databases I am currently using Hibernates schema export to generate

5条回答
  •  遥遥无期
    2020-12-31 04:32

    Liquibase handles it quite fine. It looks at your database at the current state, finds unapplied changesets and generates an SQL script with update command in sql output mode.

    Using a proper database migration tool instead of Hibernate generator is the way to go in any case, sooner or later you'll end up with a situation that Hibernate does not support. For us it was dropping an unique index and replacing it with another. You can also enable hibernate.hbm2ddl.auto=validate to feel safe about the compatibility between database structure and entity beans.

提交回复
热议问题