Can Flyway find out and generate migration files from datamodel?

為{幸葍}努か 提交于 2019-12-12 14:27:40

问题


Ey everyone! :)

I have been having a look at Flyway but I am not sure about how I can use it. In my case, I have an entity model (annotated using JPA) and, for me, the useful it would be that FlyWay could find out the changes on my model every time I call "migration" and generate the migration files. That is the way such as Rails works (Rails uses a DSL but I hope you understand what I mean). As I have read in the wiki, Flyway does not work in that way but needs the migration files (sql or Java).

If I integrated Flyway in my application (programmatic), could I generate those migration files? I think the answer is "no", that way only would give me control over migrations from Java code. Am I right?

Thanks in advance :)


回答1:


This is not currently supported.

Feel free to file a request in the issue tracker: https://github.com/flyway/flyway/issues?state=open




回答2:


Flyway would have to delegate this to the jpa implementation you're using so it would be tricky.

What I would suggest however is that you use the JPA implementation to generate migration scripts that you then plugin into flyway. It's fairly simple with openjpa, don't know about the others.



来源:https://stackoverflow.com/questions/8864614/can-flyway-find-out-and-generate-migration-files-from-datamodel

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!