Database deployment
For database maintenece I have decided to use liquibase.
Deploy development database
mvn clean process-resources liquibase:update
For generate schema for running tests
mvn clean process-resources liquibase:update -Ptest
For generate sql scripts for test environment
mvn clean process-resources liquibase:updateSQL -Ptest-deploy
You can find generated sql file in:
./target/liquibase/migrate.sql
For rollaback to clean database on test environment
mvn clean process-resources liquibase:rollback -Ptest -Dliquibase.rollbackTag=version_1.0