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

Cannot seem to custom migrate with mapping models because tables are not updated #190

Open
jasper-ch-chan opened this issue Sep 2, 2015 · 7 comments

Comments

@jasper-ch-chan
Copy link
Contributor

I was wondering if anyone has tried using Migration policies to perform a custom migration? I am currently struggling with this as I've noticed when executeFetchRequest gets called and it tries to insert my migrated data (which is correct) into the context, the entity table attributes haven't been updated yet and thus, causing a failure.

@jasper-ch-chan
Copy link
Contributor Author

@sascha I know you were able to overcome some migration issues with custom migration. Would you be able to shed some light as to how you were able to overcome this issue?

@sascha
Copy link
Contributor

sascha commented Sep 9, 2015

@jasper-ch-chan I've only really used lightweight migrations so far (NSMigratePersistentStoresAutomaticallyOption, NSInferMappingModelAutomaticallyOption), but may need support for custom migrations soon. I'm afraid the issue I described at #14 still exists, so this is probably a rather complex task.

@jasper-ch-chan
Copy link
Contributor Author

@gavin-black Could we get some support with regards to custom migrations? This is becoming a pretty critical issue for our software as well.

@jasper-ch-chan
Copy link
Contributor Author

@sascha Just for your information, I made a simple little playground to do all my ECD testing. Feel free to fork and use it as your experimentation project too!

https://github.com/sdwornik/ECD-Migration

@gavin-black
Copy link
Member

Hi @jasper-ch-chan,

Unfortunately I don't feel equipped to really help with this. I've never used custom migrations, let alone going through under the hood to really implement everything myself. I do remember reading about the set of possible operations that are supported a while back (transform, add, etc.). But actually learning migrations, adding in support for each method of migration, testing them properly, while making sure I don't clobber anything else, is unlikely in any sane amount of time. Definitely will help with any questions or pull requests, but outside of that I'm not sure what support I can offer.

-- Gavin

@jasper-ch-chan
Copy link
Contributor Author

@dorada Will we be able to get some assistance with this regards? I've figured out that essentially, metadataForPersistentStoreOfType:URL:error: is returning nil as it is not implemented in ECD.

@DanielBroad
Copy link
Contributor

My employer doesn't use custom migrations, so I can't justify writing the code for you.

Happy to review any pull request.

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

4 participants