Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CalenTask/App/CalenTaskApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ struct CalenTaskApp: App {
static let cloudKitContainerID = "iCloud.it.mecena.CalenTask"

var sharedModelContainer: ModelContainer = {
let schema = Schema(versionedSchema: CalenTaskSchemaV11.self)
let schema = Schema(versionedSchema: CalenTaskSchemaV12.self)

// 1ª scelta: database privato CloudKit — stessa vita su Mac e iPhone.
// Migrazione AUTOMATICA lightweight (fix v7): il piano a stadi
Expand Down
10 changes: 10 additions & 0 deletions CalenTask/Models/CalenTaskSchema.swift
Original file line number Diff line number Diff line change
Expand Up @@ -170,3 +170,13 @@ enum CalenTaskSchemaV11: VersionedSchema {
CalenTaskSchemaV2.models
}
}

/// V12 (#5): aggiunge `#Index` su `TodoTask` (`deletedAt`+`statusRaw`,
/// `workspaceID`, `startAt`, `dueAt`). Nessuna proprietà nuova.
enum CalenTaskSchemaV12: VersionedSchema {
static var versionIdentifier: Schema.Version { Schema.Version(12, 0, 0) }

static var models: [any PersistentModel.Type] {
CalenTaskSchemaV2.models
}
}
3 changes: 3 additions & 0 deletions CalenTask/Models/TodoTask.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ import SwiftData
// The unified core entity: todo + calendar event + reminder + phase container.
// Named TodoTask because `Task` collides with _Concurrency.Task.
// Maps to future Supabase table `tasks`.
// #5: indici sui campi dei predicati di dominio (`TodoTask+Predicates`).
@Model
final class TodoTask {
#Index<TodoTask>([\.deletedAt, \.statusRaw], [\.workspaceID], [\.startAt], [\.dueAt])

var id: UUID = UUID()
var workspaceID: UUID = UUID()
var title: String = ""
Expand Down
Loading