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) {
|
init(isUnitTest: Bool = false) {
|
||||||
self.container = NSPersistentContainer(name: Self.modelName, managedObjectModel: .sharedModel)
|
self.container = NSPersistentContainer(name: Self.modelName, managedObjectModel: .sharedModel)
|
||||||
|
let description = container.persistentStoreDescriptions.first
|
||||||
|
description?.shouldMigrateStoreAutomatically = false
|
||||||
|
description?.shouldInferMappingModelAutomatically = false
|
||||||
if isUnitTest {
|
if isUnitTest {
|
||||||
let description = NSPersistentStoreDescription()
|
description?.url = URL(fileURLWithPath: "/dev/null")
|
||||||
description.url = URL(fileURLWithPath: "/dev/null")
|
|
||||||
container.persistentStoreDescriptions = [description]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue