Skip to content

Commit a43f2b0

Browse files
authored
Set auto migration to false (#675)
1 parent a69c4d1 commit a43f2b0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

passKit/Controllers/CoreDataStack.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ public class PersistenceController {
2020

2121
init(isUnitTest: Bool = false) {
2222
self.container = NSPersistentContainer(name: Self.modelName, managedObjectModel: .sharedModel)
23-
23+
let description = container.persistentStoreDescriptions.first
24+
description?.shouldMigrateStoreAutomatically = false
25+
description?.shouldInferMappingModelAutomatically = false
2426
if isUnitTest {
25-
let description = NSPersistentStoreDescription()
26-
description.url = URL(fileURLWithPath: "/dev/null")
27-
container.persistentStoreDescriptions = [description]
27+
description?.url = URL(fileURLWithPath: "/dev/null")
2828
}
2929
}
3030

0 commit comments

Comments
 (0)