Rename core data store during migration

This commit is contained in:
relikd
2019-10-03 21:34:56 +02:00
parent 850351a966
commit b33791cae3
4 changed files with 20 additions and 4 deletions

View File

@@ -109,7 +109,8 @@
- (NSPersistentContainer *)persistentContainer {
@synchronized (self) {
if (_persistentContainer == nil) {
_persistentContainer = [[NSPersistentContainer alloc] initWithName:@"DBv1"];
NSManagedObjectModel *mom = [NSManagedObjectModel mergedModelFromBundles:nil];
_persistentContainer = [[NSPersistentContainer alloc] initWithName:@"Library" managedObjectModel:mom];
[_persistentContainer loadPersistentStoresWithCompletionHandler:^(NSPersistentStoreDescription *storeDescription, NSError *error) {
if ([error inCaseLog:"Couldn't read NSPersistentContainer"])
abort();