{"action":"opened","issue":{"url":"https://api.github.com/repos/realm/realm-cocoa/issues/2640","labels_url":"https://api.github.com/repos/realm/realm-cocoa/issues/2640/labels{/name}","comments_url":"https://api.github.com/repos/realm/realm-cocoa/issues/2640/comments","events_url":"https://api.github.com/repos/realm/realm-cocoa/issues/2640/events","html_url":"https://github.com/realm/realm-cocoa/issues/2640","id":110024745,"number":2640,"title":"Migration block not calling in multiple realm files","user":{"login":"jplazcano87","id":3168897,"avatar_url":"https://avatars.githubusercontent.com/u/3168897?v=3","gravatar_id":"","url":"https://api.github.com/users/jplazcano87","html_url":"https://github.com/jplazcano87","followers_url":"https://api.github.com/users/jplazcano87/followers","following_url":"https://api.github.com/users/jplazcano87/following{/other_user}","gists_url":"https://api.github.com/users/jplazcano87/gists{/gist_id}","starred_url":"https://api.github.com/users/jplazcano87/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jplazcano87/subscriptions","organizations_url":"https://api.github.com/users/jplazcano87/orgs","repos_url":"https://api.github.com/users/jplazcano87/repos","events_url":"https://api.github.com/users/jplazcano87/events{/privacy}","received_events_url":"https://api.github.com/users/jplazcano87/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-06T14:48:24Z","updated_at":"2015-10-06T14:48:24Z","closed_at":null,"body":"i need to run a migration in multiple .realm files, i do this, but the migration block is never called, the app continues running and crash due the lack of migration i put a breakpoint and found out that the migration block is never been called\r\n\r\n```\r\n//migration block\r\nRLMMigrationBlock migrationBlock =  ^(RLMMigration *migration, uint64_t oldSchemaVersion) {\r\n    \r\n    if (oldSchemaVersion < 1) {\r\n      [migration enumerateObjects:ScreenModel.className block:^(RLMObject *oldObject, RLMObject *newObject) {\r\n        newObject[@\"was_showed\"] = @NO;\r\n        \r\n      }];\r\n    }\r\n  };\r\n\r\n  NSMutableArray *pathArray = [[NSMutableArray alloc] init];\r\n  NSArray *dirpaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);\r\n  NSString *docsDir =dirpaths[0];\r\n  \r\n  \r\n  NSArray* dirs = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:docsDir\r\n                                                                      error:NULL];\r\n  ///enumeration of .realm files in the filesystem\r\n  [dirs enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {\r\n    NSString *filename = (NSString *)obj;\r\n    NSString *extension = [[filename pathExtension] lowercaseString];\r\n    if ([extension isEqualToString:@\"realm\"]) {\r\n      \r\n      NSString *defaultRealmPath = [RLMRealmConfiguration defaultConfiguration].path;\r\n      NSString *defaultRealmParentPath = [defaultRealmPath stringByDeletingLastPathComponent];\r\n \r\n      NSLog(@\"path %@\",[defaultRealmParentPath stringByAppendingPathComponent:filename]);\r\n// run the migration for each .ream file in the filesystem\r\n      RLMRealmConfiguration *config = [RLMRealmConfiguration defaultConfiguration];\r\n      config.schemaVersion = 1;\r\n      config.migrationBlock = migrationBlock;\r\n      config.path = [defaultRealmParentPath stringByAppendingPathComponent:filename];\r\n      [RLMRealm migrateRealm:config];\r\n    }\r\n  }];\r\n```"}}