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

Option to validate only until current version of the schema #906

Closed
sambekar opened this issue Dec 8, 2014 · 5 comments
Closed

Option to validate only until current version of the schema #906

sambekar opened this issue Dec 8, 2014 · 5 comments

Comments

@sambekar
Copy link

sambekar commented Dec 8, 2014

I want to validate my migration scripts against an existing database on which I have applied some migration. Now my classpath contains scripts which would be applied on the said database in future.
After 3.0 the validate method defaults the option to allow pendingOrFuture migration in validate method to false.

Whats the purpose of having this configurable item if its defaulted to false?
Can we make it configurable?

doValidate(connectionMetaDataTable, connectionUserObjects, migrationResolver, metaDataTable, schemas,false);

@axelfontaine
Copy link
Contributor

The use of this internally is the validateOnMigrate functionality, where you want to validate with this set to true before migrating.

I agree that providing this functionality separately also makes sense.

@axelfontaine
Copy link
Contributor

Note that as a workaround, you can use

flyway.setTarget(flyway.info().current());
flyway.validate();

@sambekar
Copy link
Author

Thanks, I am using the workaround for now.

@axelfontaine
Copy link
Contributor

We now have PR #912 this as well.

However, there are multiple things to consider:

Thoughts welcome.

@sanjayd
Copy link
Contributor

sanjayd commented Dec 29, 2014

Looking at the problem a little deeper I think I agree that the extra config parameter is a bit superfluous. I think I prefer the special value for 'target' to repurposing setIgnoreFailedFutureMigration. The latter I think adds unnecessary ambiguity to that parameter whereas the former would just be formalizing the workaround (and giving access to it from Spring contexts). See PR #913

@axelfontaine axelfontaine changed the title Option to validate against an existing database with pending or future migration not configurable Option to validate only until current version of the schema Jan 10, 2015
axelfontaine pushed a commit to flyway/flywaydb.org that referenced this issue Jan 10, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants