开发者

Flyway migration during ear deployment

开发者 https://www.devze.com 2023-03-08 06:14 出处:网络
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.

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 th开发者_StackOverflow中文版at 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消