Delete migration in flyway

This questions is related to Best pratice: How to modify flyway migration script after it has been used

The basic answer is: don't delete once it's been applied

It doesn't matter if during the migration process some intermediary state isn't exactly what you want, as long as the final one (1.48 in your case) is correct.

Now if you really need to delete this migration, ask yourself whether replacing it with an empty file could also do the job. If yes you could then follow the advice I gave here: https://stackoverflow.com/a/35491545/350428

Now if that's still not enough and you really really need to delete this migration, delete the file and patch up the flyway_schema_history table by hand to make it consistent again. This is risk-prone and should be an absolute last resort solution.


you can UNDO your migration: UNDO flyway migration

Tags:

Flyway