How to change from non-versioned to versioned schema in swiftdata?

My app is using SwiftData, but I deployed it to the app store with no VersionedSchema applied without thinking about migrating the model. Now I need to migrate the data and I need help from someone who has experience moving from non-versioned to versioned.

Assuming I currently have a version1, version2 schema, it works fine for the initial install situation, but when I migrate to version1, version2 in an app that is listed on the app store, I run into problems.

I don't have any logs to show for it. Thread 1: EXC_BAD_ACCESS (code=2, address=0x16a6578f0) If anyone has had the same experience as above, please respond, thanks!

Let me know what kind of logs you need and I'll add them as a comment.

I would love to know if you've found an answer to this problem. I had the same issue and having been searching everywhere for an answer with no real luck.

Have you tried creating a first schema (version 1) having the model identical to your non-versioned model? Then create a second schema with the updated version of your model. I was thinking about the same stuff before publishing the app. It was approved but I rejected it thinking about what would happen if I want to migrate my SwiftData database to a new version without having an initial schema..

How to change from non-versioned to versioned schema in swiftdata?
 
 
Q