I was running a db repair command on my db, and surpassingly found out later that for each old migration version a new DELETE migration was created.
It was only effecting the flyway_schema_history table, the rest of the tables stayed the same, and nothing was deleted/ dropped.
But, now when I am trying to run migrations scripts I get failures when running the flyway, since it tries to run the first migration script again. I do not want to delete this migrations.
Can someone explain to me why did it happen, and much more important, do I have a way to revert it and delete the DELETE rows?
As of Flyway 7, running
repairmarks any migrations that areMissingasDELETEDin theflyway_schema_historytable, which is a way of telling Flyway that the migrations have been removedIf the migrations aren't
Missing, what has likely happened is you haven't configuredflyway.locationswhen runningrepairAs for fixing it, there are two options that are the most ideal as of today:
flyway.skipExecutingMigrationswhen runningmigrateto update theflyway_schema_historytable, telling Flyway that the migrations are applied again, without actually executing themflyway_schema_historytable and delete theDELETErows