Post

Replies

Boosts

Views

Activity

Reply to Local SwiftData to CloudKit migration
let fromSchema = Schema(versionedSchema: ModelSchema_050624.self) let starterConfiguration = ModelConfiguration( nil, schema: fromSchema, isStoredInMemoryOnly: false, allowsSave: true, groupContainer: groupContainer, cloudKitDatabase: .none ) let modelContainer = try ModelContainer( for: Country.self, Episode.self, Movie.self, Season.self, Show.self, Network.self, NetworkSubscription.self, migrationPlan: AppModelMigrationPlan.self, configurations: starterConfiguration ) return modelContainer If the CloudKit entitlement is active (checked), this code throws: Thread 1: Fatal error: Could not initialize model container SwiftDataError(_error: SwiftData.SwiftDataError._Error.configurationSchemaNotFoundInContainerSchema) If the CloudKit entitlement is not active, this code migrates successfully.
3w
Reply to Local SwiftData to CloudKit migration
I've got some news, which are discomforting: I can drive from local to cloudkit if I relaunch the app with changes, simulating multiple updates. In short, if I follow these passages, everything seems to work: Remove any cloudkit entitlement Migrate the local swiftData to a CloudKit-compatible schema Re-add the CloudKit entitlement Migrate the ModelConfiguration to use the preferred cloudKitDatabase This is definitely not something I can do, as I there must be a way to execute all these steps in one go? It also seems that a cloudKitDatabase: .none is not respected.
3w