Wow! Now I understand, thank you very much. This has been very insightful.
Building up on the previous example, what could be possible causes why didMigrate is not being called?
I wrote a print statement and some code, but it's never run.
static let migrateV1toV2 = MigrationStage.custom(
fromVersion: SchemaV1.self,
toVersion: SchemaV2.self,
willMigrate: nil,
didMigrate: { context in
print("Running Post Migration")
// post-migration code here
}
)
My current workaround was to run the post-migration code outside the MigrationStage.