mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-01-18 15:07:00 +01:00
reversible migrations
This commit is contained in:
@@ -199,7 +199,7 @@ public final class DataStack {
|
||||
configuration: configuration,
|
||||
URL: fileURL,
|
||||
options: [
|
||||
NSSQLitePragmasOption: ["WAL": "journal_mode"],
|
||||
NSSQLitePragmasOption: ["journal_mode": "WAL"],
|
||||
NSInferMappingModelAutomaticallyOption: true,
|
||||
NSMigratePersistentStoresAutomaticallyOption: automigrating
|
||||
]
|
||||
@@ -254,7 +254,7 @@ public final class DataStack {
|
||||
configuration: configuration,
|
||||
URL: fileURL,
|
||||
options: [
|
||||
NSSQLitePragmasOption: ["WAL": "journal_mode"],
|
||||
NSSQLitePragmasOption: ["journal_mode": "WAL"],
|
||||
NSInferMappingModelAutomaticallyOption: true,
|
||||
NSMigratePersistentStoresAutomaticallyOption: automigrating
|
||||
]
|
||||
@@ -376,4 +376,16 @@ public final class DataStack {
|
||||
private let storeMetadataUpdateQueue = GCDQueue.createConcurrent("com.coreStore.persistentStoreBarrierQueue")
|
||||
private var configurationStoreMapping = [String: NSPersistentStore]()
|
||||
private var entityConfigurationsMapping = [String: Set<String>]()
|
||||
|
||||
deinit {
|
||||
|
||||
for store in self.coordinator.persistentStores {
|
||||
|
||||
do {
|
||||
|
||||
try self.coordinator.removePersistentStore(store)
|
||||
}
|
||||
catch _ { }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user