skills/willsigmon/sigstack/SwiftData Migration Writer

SwiftData Migration Writer

SKILL.md

SwiftData Migration Writer

Create migration from UserDefaults to SwiftData:

  1. Map keys to entity fields

  2. Write migration method:

    func migrateXIfNeeded() async throws {
        guard !hasMigrated("X") else { return }
        // Read UserDefaults
        // Create/update entity
        // Archive old keys
        // Mark migrated
    }
    
  3. Add to PreferencesStore extension

  4. Call on first load

  5. Test data preservation

Use when: Creating SwiftData entities, migrating preferences, data persistence

Weekly Installs
0
GitHub Stars
7
First Seen
Jan 1, 1970