Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Going from setupCoreDataStackWithStoreNamed to setupCoreDataStackWithAutoMigratingSqliteStoreNamed #562

Closed
johnphan opened this Issue · 3 comments

4 participants

@johnphan

I have an app already submitted using setupCoreDataStackWithStoreNamed without xcdatamodeld versioned and now that I've learned about setupCoreDataStackWithAutoMigratingSqliteStoreNamed and created a new version of xcdatamodeld. I've checked the .sqlite store and it looks like it's still using the old model even if I point it to the new version of the model.

Can anyone help me with migrating from setupCoreDataStackWithStoreNamed to setupCoreDataStackWithAutoMigratingSqliteStoreNamed for a already submitted application without wiping the data?

Thanks,
John

@casademora
Owner
@johnphan

Cool, thanks. I did some experiment that when an non-versioned model setup by setupCoreDataStackWithStoreNamed and than upgrade to setupCoreDataStackWithAutoMigratingSqliteStoreNamed, the data didn't migrate. But if I have version the non-versionmodel and run setupCoreDataStackWithAutoMigratingSqliteStoreNamed to setup, and than update the model based on that version, the data seem to migrate.

This is what I plan to do, submit another version of the app with the same model that is "versioned" using setupCoreDataStackWithAutoMigratingSqliteStoreNamed. The subsequent versions will migrate automagically. Tested in the simulator and device, hope it will perform the same in the app store.

Thanks.
John

@l4u

@johnphan
Do you mean these?
version 1: non-versioned model + setupCoreDataStackWithStoreNamed
version 2: non-versioned model + setupCoreDataStackWithAutoMigratingSqliteStoreNamed
version 3: versioned + setupCoreDataStackWithAutoMigratingSqliteStoreNamed

Thanks!!

Are there any other ways for migration when the store is set up with setupCoreDataStackWithStoreNamed ?

@tonyarnold tonyarnold closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.