-1

If some script fails during migration , flyway won't add record to schema_version in DB2 db for failed statement.

Do you have any idea how to avoid this situation?

I did a migration, 4th script failed, i expect this script will have status ABORTED/FAILED

  • Do you mean change the schema_version even if a migration failed? Sounds like a bad idea. – mao Sep 14 '17 at 09:55
  • no, i mean that if some script fails during migration in DB2, you do not need to use command repair, failed script has status "Pending" – Aleksandr Kronh Sep 14 '17 at 10:40
  • Seems that flyway documents that attempted and unapplied migrations remain in status pending. The -612 (duplicate name) suggests that there is a coding error in the relevant script, so why not fix that problem? – mao Sep 14 '17 at 10:52
  • if was just for example. During migration to Oracle db, if some script fails you need to fix this script and perform command REPAIR before command MIGRATE. I am asking why during migration to DB2 you do not need to do repair. Thy failed script has status PENDING – Aleksandr Kronh Sep 14 '17 at 11:44

1 Answers1

1

One explanation for flyway behavior difference that you observe is the way Oracle handles DDL (implicit commit before/after each DDL) as compared with how Db2 handles DDL (implements DDL under transaction control by default). So with Db2 it's possible to arrange for each migration to be atomic and to rollback upon failure - meaning that there is nothing to repair, and therefore no repair action required as the flyway Oracle implementation may need.

mao
  • 11,321
  • 2
  • 13
  • 29