If you change a scheme of your CoreData such as adding a new attribute, you can easily migrate it with options below.
do {
try persistentStoreCoordinator.addPersistentStoreWithType(NSSQLiteStoreType, configuration: nil, URL: storeURL, options: [NSMigratePersistentStoresAutomaticallyOption: true , NSInferMappingModelAutomaticallyOption: true])
} catch {
fatalError("Error migrating store: \(error)")
}