What problem does it solve?
This Skill prevents catastrophic data loss and app crashes when evolving database schemas in production iOS/macOS apps. It addresses common pitfalls like NOT NULL column errors, foreign key failures, and the dangers of modifying shipped migrations.
Core Features & Use Cases
- Safe Migration Patterns: Guides for additive-only, idempotent, and transactional schema changes, ensuring data integrity.
- Comprehensive Testing Workflow: Mandatory tests for fresh installs, migration paths from previous versions, and idempotency to guarantee robustness.
- Framework-Specific Guidance: Includes safe patterns and best practices for SQLite, GRDB, and SwiftData migrations.
- Use Case: When you need to add a new nullable column to a live app's database without losing existing user data, use this skill to follow the safe additive pattern and ensure thorough testing across all scenarios.
Quick Start
To add a new nullable column newColumn to tableName, ensure idempotency by checking for its existence first, then execute ALTER TABLE tableName ADD COLUMN newColumn TEXT.