wip
This commit is contained in:
@ -9,7 +9,7 @@ final class WorkoutsContainer {
|
||||
|
||||
static func create() -> ModelContainer {
|
||||
// Using the current models directly without migration plan to avoid reference errors
|
||||
let schema = Schema(SchemaV2.models)
|
||||
let schema = Schema(SchemaV1.models)
|
||||
let configuration = ModelConfiguration(cloudKitDatabase: .automatic)
|
||||
let container = try! ModelContainer(for: schema, configurations: configuration)
|
||||
return container
|
||||
@ -20,13 +20,10 @@ final class WorkoutsContainer {
|
||||
let configuration = ModelConfiguration(isStoredInMemoryOnly: true)
|
||||
|
||||
do {
|
||||
let schema = Schema(SchemaV2.models)
|
||||
let schema = Schema(SchemaV1.models)
|
||||
let container = try ModelContainer(for: schema, configurations: configuration)
|
||||
let context = ModelContext(container)
|
||||
|
||||
// Create default data for previews
|
||||
DataLoader.create(modelContext: context)
|
||||
|
||||
return container
|
||||
} catch {
|
||||
fatalError("Failed to create preview ModelContainer: \(error.localizedDescription)")
|
||||
|
Reference in New Issue
Block a user