I've created a versioned Core Data model in my iOS app, and it has several versions created so far (several .xdatamodel files within the .xcdatamodeld bundle). Before shipping the app, I'm considering deleting these old versions so I can start with a single clean data model - and data loss isn't an issue at this stage.
Is this possible? And what would be the best way to achieve this without simply deleting all Core data files and recreating a new model.
You can delete a data model from the Data Model management page or the Data Model Editor. Just click Edit and select Delete. Note: If your role grants you the ability to create data models, it should grant you the ability to delete them as well.
Deleting the old models means you cannot migrate any existing data stores. I assume you're ok with that given your statement about data loss. If you want to start fresh, you can take the current xcdatamodel, copy it somewhere else (e.g. your Desktop), then delete the xcdatamodeld folder. At this point, you can drag your saved xcdatamodel back into Xcode and re-add it as a non-versioned file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With