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:
- I have a lot of batch files which would be sensitive to trying to add another runline option.
- 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
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.