Couple of days ago we made a mistake. We have a kubernetes cluster with a pipeline that times out in 25 minutes, meaning if the deployment wasn't done in 25 minutes, it will fail. We deployed a flyway migration that involves some queries that run for more than an hour. Stupid, I know. now we ran the queries in the migration manually, We want to manually mark the flyway migration as done, otherwise redeployment won't work. Is there a way this could be done?
So we ended up manually inserting a migration row in the database. flyway keeps a table flyway_schema_history in your schema. If you manually insert a row there it will skip the migration. The only tricky part is calculating the checksum. You can either migrate locally, get the checksum and inject it the live database, or just re-calculate the checksum on your own.
You will find how they calculate the checksum in the AbstractLoadableResource class.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With