polscm32 1 год назад
Родитель
Сommit
c0fa88f364
1 измененных файлов с 5 добавлено и 0 удалено
  1. 5 0
      Model/CoreDataStack.swift

+ 5 - 0
Model/CoreDataStack.swift

@@ -62,6 +62,11 @@ class CoreDataStack: ObservableObject {
         /// - Tag: persistentHistoryTracking
         description.setOption(true as NSNumber, forKey: NSPersistentHistoryTrackingKey)
 
+        // Enable lightweight migration
+        /// - Tag: lightweightMigration
+        description.shouldMigrateStoreAutomatically = true
+        description.shouldInferMappingModelAutomatically = true
+
         container.loadPersistentStores { _, error in
             if let error = error as NSError? {
                 fatalError("Unresolved Error \(DebuggingIdentifiers.failed) \(error), \(error.userInfo)")