How can we help you today? How can we help you today?

Flyway migration not showing failed migration for Postgres

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?
santana
0

Comments

3 comments

  • Peter_Laws
    Hello santana

    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.
    Peter_Laws
    0
  • santana
    Thanks for taking time. Yes, this is the desired behavior. But my question is more related to flyway table. Failed migration recorded on flyway table its not bean shown. I should have state  as not successfull save on record on failed migration. But im not having this.
    santana
    0
  • Peter_Laws
    This is due to the rollback, as the change was undone. Whereas a failure migration implies that the db needs some corrective action, which is not the case.

    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?
    Peter_Laws
    0

Add comment

Please sign in to leave a comment.