axiom-database-migration

Implement additive SQLite/GRDB/SwiftData migrations for iOS/macOS apps.

Updated Dec 23, 2025
One-click install
npx skills add https://github.com/pradeepmouli/swift-template --skill axiom-database-migration-pradeepmouli
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: axiom-database-migration
Source: https://github.com/pradeepmouli/swift-template/tree/main/.agents/skills/axiom-database-migration
Command: npx skills add https://github.com/pradeepmouli/swift-template --skill axiom-database-migration-pradeepmouli

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Migrations are immutable after shipping; this skill ensures safe, additive schema evolution for production apps using SQLite/GRDB/SwiftData, protecting user data during upgrades on iOS/macOS.

Core Features & Use Cases

  • Additive, idempotent migrations that can be applied safely on fresh installs and existing users
  • Handles common schema evolution patterns (add column, add foreign keys, backfill data, complex refactors) with testing
  • Enforces best practices like transactional migrations and immutable shipped migrations

Quick Start

Follow this process to add a new migration, test it against previous versions, and verify data preservation during upgrades.

Frequently Asked Questions about axiom-database-migration

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

FAQPage Schema
How do I safely add a new column to an SQLite database in my iOS app?

To safely add a new column to an SQLite database in your iOS app, use additive, idempotent migrations that preserve existing user data. This approach ensures schema changes apply safely to both fresh installs and existing users during upgrades.

What is the best way to handle SQLite schema changes with GRDB on macOS?

The best way to handle SQLite schema changes with GRDB on macOS is to enforce transactional, immutable migrations. This protects user data during upgrades by ensuring complex refactors, type changes, and foreign key additions execute safely or roll back entirely.

Can I change column types and backfill data in SwiftData without losing user records?

Yes, you can change column types and backfill data in SwiftData without losing user records by applying safe, additive schema migrations. These migrations enforce NOT NULL constraints and ensure data preservation across existing user databases during upgrades.

Why do database migrations fail when adding NOT NULL columns to existing SQLite tables?

Database migrations fail when adding NOT NULL columns to existing SQLite tables because existing rows lack valid values for the new constraint. Safe migration practices require backfilling data before applying NOT NULL constraints to preserve user records.

How do I test SQLite migrations for both fresh installs and existing iOS users?

To test SQLite migrations for both fresh installs and existing iOS users, verify idempotent migration scripts against previous database versions. This process checks data preservation and confirms schema evolution applies correctly across all upgrade paths.