flyway clean is not dropping scheduler jobs or pro

2019-07-23 23:07发布

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条回答
放荡不羁爱自由
2楼-- · 2019-07-23 23:56

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.

查看更多
登录 后发表回答