Deleting Production Database SwiftData

Hi all,

I have setup my app to use SwiftData with CloudKit sync. I have a production environment and development environment. I can reset the development environment for myself and all users in CloudKit console, but I can't reset the production one as it's tried to users' iCloud accounts, so I've added a button in-app for that feature. In the onboarding of my app, I pre-seed the DB with some default objects, which should be persisted between app install. The issue I'm running into is that I'm unable to force-pull these models from iCloud during the onboarding of a clean re-install, which leads to the models later appearing as duplicates once the user has been on the app for a few minutes and it has pulled from their iCloud account. If anyone has any suggestions on how to handle this issue, I would greatly appreciate it.

Seed data should be shipped as a local store that's part of the application bundle. Certainly it doesn't need to be synced.

Simply add it to your ModelContainer using an additional ModelConfiguration and the objects will be visible to your queries along with any that come from CloudKit.

Deleting Production Database SwiftData
 
 
Q