SwiftData schema version not match

I have two versionedSchema V1VersionedSchema, V2VersionedSchema.

When i create schema with versionedSchema like code below and check version using breakpoint, V1, V2 Schema encodingVersion is same.

        let v3Schema = Schema(versionedSchema: V1VersionedSchema.self)
// encodingVersion: 1.0.0
// schemaEncodingVersion: 1.0.0

        let v2Schema = Schema(versionedSchema: V2VersionedSchema.self)
// encodingVersion: 1.0.0
// schemaEncodingVersion: 2.0.0

Why encoding version is same? (I think migration plan v1 to v2 isn't work becaus of that)

I think I encountered the same problem as you.

SwiftData schema version not match
 
 
Q