Can Flyway find out and generate migration files f

2019-07-07 06:20发布

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 :)

标签: flyway
2条回答
The star\"
2楼-- · 2019-07-07 06:43

This is not currently supported.

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

查看更多
时光不老,我们不散
3楼-- · 2019-07-07 07:01

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.

查看更多
登录 后发表回答