axiom-swiftdata-migration

Guide SwiftData schema migrations with VersionedSchema and SchemaMigrationPlan.

Updated Dec 3, 2025
One-click install
npx skills add https://github.com/tuliopc23/flying-dutchman-app --skill axiom-swiftdata-migration
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: axiom-swiftdata-migration
Source: https://github.com/tuliopc23/flying-dutchman-app/tree/main/.claude/skills/axiom-swiftdata-migration
Command: npx skills add https://github.com/tuliopc23/flying-dutchman-app --skill axiom-swiftdata-migration

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps developers navigate the complexities of updating SwiftData schemas in their applications, ensuring data integrity and a smooth user experience during app updates.

Core Features & Use Cases

  • Schema Versioning: Define and manage multiple versions of your SwiftData models.
  • Custom Migrations: Implement complex data transformations, type changes, and relationship restructuring.
  • Lightweight Migrations: Leverage automatic migration for simpler changes like adding or renaming properties.
  • Testing Strategies: Provides guidance on thoroughly testing migrations on simulators and real devices.
  • Use Case: You need to change a String property in your Note model to an AttributedString. This Skill guides you through the two-stage migration process to safely convert existing data.

Quick Start

Use the axiom-swiftdata-migration skill to learn how to change a property type from String to AttributedString in your SwiftData models.

Frequently Asked Questions about axiom-swiftdata-migration

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I migrate a SwiftData property type from String to AttributedString?

To migrate a SwiftData property type from String to AttributedString, you implement a two-stage migration process using VersionedSchema and SchemaMigrationPlan to safely convert existing data while preserving model integrity.

When should I use custom SwiftData schema migrations instead of lightweight migrations?

You need custom SwiftData schema migrations using VersionedSchema when handling complex data transformations like property type changes or relationship restructuring, whereas lightweight migrations only cover simpler automatic changes like adding or renaming properties.

Does SwiftData migration preserve one-to-many and many-to-many relationships?

SwiftData custom schema migrations address relationship preservation for one-to-many and many-to-many connections, ensuring that existing data links remain intact and valid when you update your model definitions across versions.

What is the willMigrate and didMigrate limitation in SwiftData migrations?

The willMigrate and didMigrate limitation in SwiftData refers to lifecycle constraints during the migration process, requiring developers to adopt two-stage migration patterns to handle complex data transformations safely.

How do I test SwiftData schema migrations on real devices?

Testing SwiftData schema migrations on real devices requires running the SchemaMigrationPlan on simulators and physical hardware to thoroughly validate data integrity, relationship preservation, and type conversion behavior.

How do I define multiple versions of a SwiftData model?

You define multiple versions of a SwiftData model using VersionedSchema to manage schema versioning, allowing your application to track model definitions and execute custom migrations through SchemaMigrationPlan.