Problem Statement
Describe how you would handle data migration when your persistent model changes (e.g., adding fields) using `Codable` or `CoreData` in Swift.
Explanation
When your model changes, you must consider how existing persisted data will map to the new model schema. /n/n With `Codable` you would version your data formats, provide default values for new fields, handle missing keys using `decodeIfPresent`, or write migration code to read old files and write them into new format. With `Core Data` you use versioned model files, light-weight migrations or manual migration logic, map old entities to new ones, preserve user data and test migration paths thoroughly. /n/n In interviews showing you understand versioning, backward compatibility, error handling for invalid data and testing migration paths demonstrates depth of persistence design in Swift.