Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow newer migrations to exist and be skipped by validateOnMigrate #816

Closed
adrianchung opened this issue Aug 5, 2014 · 1 comment
Closed
Labels
Milestone

Comments

@adrianchung
Copy link

@adrianchung adrianchung commented Aug 5, 2014

Since flyway 3.0, the validateOnMigrate is set to true by default. This causes problems with our blue-green deployment strategy.

Scenario:

  • Old code running on EC2 instance, running on schema version 10
  • Bring up new EC2 instance, running on schema version 11, database is now upgraded. At this point, both the old and the new code is running simultaneously.
  • Restart services on old EC2 instance, or start a new EC2 instance using the old code (perhaps done through autoscaling groups).

In this scenario, we won't be able to restart the services on the old EC2 instance because it will detect version 11 of the schema has been applied. An exception message like: Caused by: org.flywaydb.core.api.FlywayException: Validate failed. Found differences between applied migrations and available migrations: Detected applied migration missing on the classpath: 11.

All of our schema changes are backwards compatible, so it'd be nice if we can set an option to ignore detecting newer schema versions.

I realize there is a 'target' property, but that is less than ideal because I don't want to update that every time I add a new schema change.

Ideally, I'd have a property that I can set to just ignore newer schema versions detected, but continue to validate the checksums of schemas up to the the latest applied version in code.

@axelfontaine
Copy link
Contributor

@axelfontaine axelfontaine commented Aug 7, 2014

Hi Adrian,

thanks for the suggestion. Yes, this makes sense. This is actually already available for failed migrations, but not for successful ones. Maybe the existing property could simply be generalized.

Cheers
Axel

@axelfontaine axelfontaine added this to the Flyway 3.1 milestone Aug 7, 2014
@axelfontaine axelfontaine added t: bug and removed t: feature labels Nov 25, 2014
@axelfontaine axelfontaine changed the title Allow newer schemas to be exist and be skipped by validateOnMigrate Allow newer migrations to exist and be skipped by validateOnMigrate Nov 25, 2014
axelfontaine added a commit to flyway/flywaydb.org that referenced this issue Nov 25, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.