Add Core Data Index to certain Attributes via migration
Posted
by steipete
on Stack Overflow
See other posts from Stack Overflow
or by steipete
Published on 2010-02-01T17:44:10Z
Indexed on
2010/03/29
20:23 UTC
Read the original article
Hit count: 361
For performance reasons, i want to set the Indexed Attribute to some of my entities. I created a new core data model version to perform the changes. Core Data detects the changes and migrates my model to the new version, however, NO INDEXES ARE GENERATED.
If I recreate the database from scratch, the indexes are there. I checked with SQLite Browser both on the iPhone and on the Simulator. The problem only occurs if a database in the prior format is already there.
Is there a way to manually add the indexes? Write some sql for that? Or am I missing something? I did already some more critical migrations, no problems there. But those missing indexes are bugging me.
Thanks for helping!
© Stack Overflow or respective owner