Flyway migration not showing failed migration for Postgres
santana
Posts: 2 New member
Im running flyway scripts to postgress database, i have one failed migration, but this failed migration is not showing up on flyway table. Im able to see successful migration, but not failed.
Any ideas why?
Any ideas why?
Answers
Great question, thank you. This is almost certainly due to your migration being handled in a transaction and due the failure automatically being rolled back. This functionality in flyway is db dependant, SQL Server and Postgres do it automatically.
I've mocked up a quick example here, including a info call afterwards so you can see how flyway views the migration status after the event.
Were it either on a db incapable of rolling back, or for some other reason be unable to roll back, instead of showing as pending due to effectively never happening, it would have a status of failed.
I appreciate this might not align with your expectations, it's a nuance in the different between success / failure of the tool running and success / failure of the code being deployed.
Essentially you're looking for some proof that your intervention is required, which presently doesn't exist, or a historical record of events?