wip
This commit is contained in:
@ -8,9 +8,10 @@ final class WorkoutsContainer {
|
||||
)
|
||||
|
||||
static func create() -> ModelContainer {
|
||||
let schema = Schema(versionedSchema: SchemaV1.self)
|
||||
// Using the current models directly without migration plan to avoid reference errors
|
||||
let schema = Schema(SchemaV2.models)
|
||||
let configuration = ModelConfiguration(cloudKitDatabase: .automatic)
|
||||
let container = try! ModelContainer(for: schema, migrationPlan: WorkoutsMigrationPlan.self, configurations: [configuration])
|
||||
let container = try! ModelContainer(for: schema, configurations: configuration)
|
||||
return container
|
||||
}
|
||||
|
||||
@ -19,7 +20,7 @@ final class WorkoutsContainer {
|
||||
let configuration = ModelConfiguration(isStoredInMemoryOnly: true)
|
||||
|
||||
do {
|
||||
let schema = Schema(SchemaV1.models)
|
||||
let schema = Schema(SchemaV2.models)
|
||||
let container = try ModelContainer(for: schema, configurations: configuration)
|
||||
let context = ModelContext(container)
|
||||
|
||||
|
Reference in New Issue
Block a user