import SwiftUI import RealmSwift
@main struct UniqueHolidayApp: App { init() { migrateRealmIfNeeded() }
var body: some Scene {
WindowGroup {
ContentView()
}
}
private func migrateRealmIfNeeded() {
let config = Realm.Configuration(
schemaVersion: 1,
migrationBlock: { migration, oldSchemaVersion in
if oldSchemaVersion < 1 {
// Realm will handle changes automatically for simple additions/removals
}
}
)
Realm.Configuration.defaultConfiguration = config
}
}