1

Given an existing database that was setup using Flyway, and I want to migrate this database to the latest version of my RDBMS (ex. Postgres 9.2->9.3).

If the database vendor changes something in its API and one of my already run migration now produces an error, I will not be able to setup new development databases with version 9.3 using the same migration scripts. I will have to modify the failing migration script(s).

Then, if I upgrade my production database to postgres 9.3, and try to run some new migration, then the existing production database won't allow me to migrate because of checksum mismatches for the migration scripts that were modified.

What's the best approach to address this situation? The only way I see presently is to manually change the checksum values in the schema_version table for production database.

user2864740
  • 60,010
  • 15
  • 145
  • 220
Patrick M
  • 166
  • 12
  • A database upgrade should not break Flyway because the upgrade will not change the checksums stored in the database. And migrations that have already been run won't need to be re-run again as the existing database structure will be preserved if you do the upgrade correctly. –  Apr 01 '14 at 21:14
  • @a_horse_with_no_name Yes, but setting up a new development database will cause an error when calling the old (invalid) api. – Patrick M Apr 01 '14 at 21:23
  • But that would be a "clean" fail wouldn't it - meaning it will get rolled back? Does Flyway have a concept of "synchronizing" the checksums with the migrations? And which API change are you talking about? Testing this should not take very long. –  Apr 01 '14 at 21:26
  • Hmmm, could this maybe be the solution to this? -> https://github.com/flyway/flyway/issues/618 – Axel Fontaine Apr 02 '14 at 07:01
  • Yes Axel, this would probably fit my needs. @a_horse_with_no_name I did not have a specific API change in mind for postgres (I don't believe 9.2->9.3 breaks anything). I was only speculating if something like this happened. I wouldn't want to roll-back and clean the database. I want it to fully migrate. – Patrick M Apr 02 '14 at 11:54
  • Liquibase can do that update of the checksum... –  Apr 02 '14 at 11:56

0 Answers0