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

From which version is not specified #17

Open
oonoo opened this issue Mar 24, 2014 · 3 comments
Open

From which version is not specified #17

oonoo opened this issue Mar 24, 2014 · 3 comments

Comments

@oonoo
Copy link

oonoo commented Mar 24, 2014

If i need to migrate from lets say 1.0 to 1.1 and i would use your method migrateToVersion:block: with the parameter @"1.1" for the version, than the block would be executed if the current Version is 1.1 no matter if there was an old version installed. And the block would get executed if the app version is higher. For example if the initial install of the user is 2.0 than the block would get executed.

Please correct me if i am wrong.

Best regards.

@pwightman
Copy link
Member

Hi @oonoo,

If i need to migrate from lets say 1.0 to 1.1 and i would use your method migrateToVersion:block: with the parameter @"1.1" for the version, than the block would be executed if the current Version is 1.1 no matter if there was an old version installed.

Yes, migrateToVersion:@"1.1" block: would run once (and only once) for every device if your new version number was @"1.1" (or higher). It doesn't care how the device got to that version (whether by new install, update, etc.)

And the block would get executed if the app version is higher. For example if the initial install of the user is 2.0 than the block would get executed.

Yes, this is also true, I think README states that all un-migrated blocks in-between version numbers will be run.

I can see how this behavior might be undesirable in certain situations, so if this conflicts with a use case you have, I'd like to hear it to get a better idea of the migration situations people are having. For example, I've thought to add a migrateFromVersion:block that runs once (and only once) if they updated from a particular version instead of to a version. So like if a bug was introduced in 1.1, then you'd use migrateFromVersion:block since other versions shouldn't be affected.

@revolter
Copy link

@pwightman, I think it shouldn't run migration blocks at all if their target version is lower that the current app's version.

@revolter
Copy link

@pwightman, Any news with the migrateFromVersion:block method?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants