문제

We would love it if Flyway could migrate our database during deployment of an .ear artifact (JBoss 4.2). It should abort if anything goes wrong.

Flyway with mvn flyway:migrate works, but for continuous integration and production environments (and maybe others that download new SNAPSHOTS) it would be great to have the DB migrations bundled with the application.

도움이 되었습니까?

해결책

The API is your friend. Integrate it in a component that runs on startup, such as a servlet. Bundle your migrations with the EAR, and you're good to go. In case the migration fails, Flyway will throw an exception which, if left uncaught, will prevent the application from starting.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top