Can Flyway find out and generate migration files f

2019-07-07 05:59发布

问题:

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.



标签: flyway