This commit is contained in:
2025-07-13 18:25:40 -04:00
parent d4514805e9
commit 0545f5dbc7
6 changed files with 164 additions and 57 deletions

View File

@ -1,13 +1,7 @@
import SwiftData
enum SchemaVersion: Int, CaseIterable {
static var allCases: [SchemaVersion] = [
.v1
]
enum SchemaVersion: Int {
case v1
static var current: SchemaVersion {
.v1
}
static var current: SchemaVersion { .v1 }
}

View File

@ -21,12 +21,11 @@ final class WorkoutsContainer {
@MainActor
static var preview: ModelContainer {
let schema = Schema(versionedSchema: SchemaV1.self)
let configuration = ModelConfiguration(schema: schema, isStoredInMemoryOnly: true)
let configuration = ModelConfiguration(isStoredInMemoryOnly: true)
do {
let container = try ModelContainer(for: schema, configurations: [configuration])
let schema = Schema(SchemaV1.models)
let container = try ModelContainer(for: schema, configurations: configuration)
let context = ModelContext(container)
// Create default data for previews