SwiftData migrations allow you to evolve your data models safely as your app updates. Start by defining VersionedSchema for each model version, even your initial one. SwiftData handles lightweight migrations automatically for simple changes like adding optional properties, removing fields, or renaming with

14m read timeFrom donnywals.com
Post cover image
Table of contents
Implementing simple versions with VersionedSchemaAutomatic migration rulesPerforming manual migrations using a migration planSetting up extra complex migrationsSummary

Sort: