Set auto migration to false (#675)
This commit is contained in:
parent
a69c4d16b1
commit
a43f2b017c
1 changed files with 4 additions and 4 deletions
|
|
@ -20,11 +20,11 @@ public class PersistenceController {
|
|||
|
||||
init(isUnitTest: Bool = false) {
|
||||
self.container = NSPersistentContainer(name: Self.modelName, managedObjectModel: .sharedModel)
|
||||
|
||||
let description = container.persistentStoreDescriptions.first
|
||||
description?.shouldMigrateStoreAutomatically = false
|
||||
description?.shouldInferMappingModelAutomatically = false
|
||||
if isUnitTest {
|
||||
let description = NSPersistentStoreDescription()
|
||||
description.url = URL(fileURLWithPath: "/dev/null")
|
||||
container.persistentStoreDescriptions = [description]
|
||||
description?.url = URL(fileURLWithPath: "/dev/null")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue