← ClaudeAtlas

swiftdata-core-data-migrationslisted

Design, implement, diagnose, and test production schema migrations for SwiftData and Core Data, including VersionedSchema snapshots, SchemaMigrationPlan stages, lightweight and custom Core Data mappings, gradual adoption, CloudKit constraints, and forward-recovery planning. Use when a persistent model changes, an existing store must upgrade without data loss, a team is choosing between SwiftData and Core Data for migration requirements, or copied production stores need validation. Do not use for ordinary fetch/query code, transient in-memory model transformations, unrelated file-format migrations, or advice that assumes Core Data should be replaced merely because SwiftData exists.
fal3/claude-skills-collection · ★ 18 · Data & Documents · score 79
Install: claude install-skill fal3/claude-skills-collection
# SwiftData and Core Data Migrations Protect the user's existing store first. Select the persistence and migration mechanism from requirements and the installed base, not from framework novelty. ## Inspect before designing Identify every supported source version, store configuration, target, and sync mode before editing models. ```bash xcodebuild -version xcrun swiftc --version xcodebuild -showBuildSettings -project App.xcodeproj -target App \ | rg 'IPHONEOS_DEPLOYMENT_TARGET|MACOSX_DEPLOYMENT_TARGET|SWIFT_VERSION' rg --files | rg '\.(xcdatamodel|xcdatamodeld|mom|momd)$|\.entitlements$|\.storekit$' rg -n 'VersionedSchema|SchemaMigrationPlan|MigrationStage|ModelContainer|NSPersistent(Container|CloudKitContainer)|NSMigrationManager' ``` Record: - Current and historical SwiftData schemas or `.xcdatamodel` versions. - Persistent-store URLs, configurations, App Group use, and SQLite sidecars. - Minimum OS for the app, extensions, tests, and packages. - CloudKit container/environment and whether production schema is deployed. - Store size, relationship cardinality, uniqueness rules, and required invariants. - All released app versions that users can upgrade from. - Whether rollback means app-binary rollback, store restoration, or forward repair. Read [the requirements and planning framework](references/decision-framework.md) before choosing a mechanism. ## Choose from requirements | Requirement | Prefer | Why | |---|---|---| | Existing healthy SwiftData store, iOS 17+ |