It's not a good idea to use hbm2ddl.auto
in production.
The only way to manage the database schema is to use incremental migration scripts because:
- the scripts will reside in VCS along with your codebase. When you check out a branch, you recreate the whole schema from scratch.
- the incremental scripts can be tested on a QA server before being applied in production
- there is no need for manual intervention since the scripts can be run by Flyway, hence it reduces the possibility of human error associated with running scripts manually.
Even the Hibernate User Guide advise you to avoid using the hbm2ddl
tool for production environments.
