implementing Core Data Migration for iOS 14 Using Lightweight Migration
I'm currently working with an scenario with migrating my Core Data model in an iOS 14 app. I've added a new attribute to my `User` entity, but the lightweight migration isn't working as expected. The app crashes with the following behavior: `Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'The entity User is missing a required property: email'`. I have confirmed that the `email` property is optional in my new model version, so I'm not sure why the migration fails. I've set up the migration options like this: ```swift let storeUrl = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first!.appendingPathComponent("MyApp.sqlite") let managedObjectModel = NSManagedObjectModel.mergedModel(from: nil)! let options = [NSMigratePersistentStoresAutomaticallyOption: true, NSInferMappingModelAutomaticallyOption: true] try persistentStoreCoordinator.addPersistentStore(ofType: NSSQLiteStoreType, configurationName: nil, at: storeUrl, options: options) ``` I’ve also checked the `xcdatamodeld` files to ensure that the new attribute is correctly marked as optional and that I have the correct version set as the current model. I've tried deleting the app from the simulator and reinstalling it, but the behavior continues. Any tips on what might be going wrong or how to debug this scenario further? Could there be something specific to iOS 14 that I'm missing regarding Core Data migrations?