swiftdata-core-data-migrationslisted
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+ |