flyway clean is not dropping scheduler jobs or programs

北战南征 提交于 2019-12-11 03:12:36

问题


I recently added a scheduler job and program to my development schema. When I tried to refresh the schema, I did a flyway clean, and then a flyway migrate.

I got the following error:

ERROR: Found non-empty schema "TESTDATA" without metadata table! Use init() or set initOnMigrate to true to initialize the metadata table.

When I dropped the job and program by hand, I was then able to run migrate again.

I've been using flyway for a while, and it's always been very straightforward - but I'm not sure how to convince it to properly clean my schema, now that I have an overnight batch job.

Note: I see the option -initOnMigrate, but this causes me two problems:

  1. I have a lot of batch files which would be sensitive to trying to add another runline option.
  2. I use flyway both to update existing schemas and to refresh schemas from scratch. If I need to modify the job or program, I could only include initOnMigrate (and have it bomb on the update), or not include it, and have it bomb on refresh (my current problem).

Thank you


回答1:


You can work around this by implementing FlywayCallback.afterClean() and do the cleanup yourself.

Also, please file an issue in the issue tracker so we can fix this in time for 3.1.



来源:https://stackoverflow.com/questions/23767341/flyway-clean-is-not-dropping-scheduler-jobs-or-programs

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