Post

Replies

Boosts

Views

Activity

Reply to How does SwiftData schema migration work and what are the possible schema changing operations
I have a similar problem when adding new properties to the models. I divide the plan into 2 phases: Migrate from V1 to V2: Add new property as optional, then assign values to the new property in the didMigrate function Migrate from V2 to V3: Mark the property as mandatory, then just do the lightWeight migration. Hope it would help!
Jul ’24
Reply to How does SwiftData schema migration work and what are the possible schema changing operations
I have a similar problem when adding new properties to the models. I divide the plan into 2 phases: Migrate from V1 to V2: Add new property as optional, then assign values to the new property in the didMigrate function Migrate from V2 to V3: Mark the property as mandatory, then just do the lightWeight migration. Hope it would help!
Replies
Boosts
Views
Activity
Jul ’24