Our developers use hbm2dll to make database schema modifications.
The hbm2ddl is set to auto in development and not enabled in other environments. For other environments the database changes are deployed through scripts using DBDeploy.
My questions are:
-
Is there a way to track hbm2ddl generated changes or have it auto generate the corresponding sql script that can then be applied using DBDeploy
-
Is hbm2ddl=auto a good development practice.
It certainly is a good practice for initial quick prototyping, but as soon as you want to have some repeatable setup and perhaps even initial values in some tables, externalizing the dbsetup is much better. You can for example use Liquibase for this task. Liquibase even allows you to diff two versions (basically 2 hbm2ddl exports).