sqlite-migrations

Recreate SQLite tables with foreign key dependencies during schema migrations.

Updated Aug 30, 2025
One-click install
npx skills add https://github.com/lbolanos/emaus --skill sqlite-migrations
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sqlite-migrations
Source: https://github.com/lbolanos/emaus/tree/main/.ruler/skills/sqlite-migrations
Command: npx skills add https://github.com/lbolanos/emaus --skill sqlite-migrations

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill addresses the challenges of performing complex schema changes in SQLite databases, preventing data loss and maintenance issues during migrations.

Core Features & Use Cases

  • Safe Schema Alterations: Provides proven patterns for adding, dropping, or renaming columns and tables without risking data integrity.
  • Migration Guidance: Offers detailed templates and decision trees for handling different migration scenarios, including recreating tables with foreign keys.
  • Use Case: When updating a production database schema that involves changing primary keys or foreign key constraints, this Skill guides developers to execute the safest approach and verify data consistency after migration.

Quick Start

Use this Skill when creating a new migration to modify table schemas involving foreign keys, following the prescribed recreate-table pattern for safe execution and validation.

Frequently Asked Questions about sqlite-migrations

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

FAQPage Schema
How do I safely modify a SQLite table schema with foreign key dependencies?

Changing primary keys or foreign key constraints in SQLite requires recreating the table. This Skill provides templates for safely copying data, renaming tables, and modifying columns while maintaining data integrity and offering recovery options during schema updates.

What is the best way to drop a SQLite column without losing data?

Dropping a SQLite column safely requires recreating the table because SQLite lacks full ALTER TABLE support. This Skill provides migration templates to copy data to a new schema, verify consistency, and swap tables without risking data loss.

Why does modifying foreign keys in SQLite require recreating the table?

Modifying foreign keys in SQLite requires recreating the table because SQLite has limited ALTER TABLE functionality and cannot directly change existing foreign key constraints. The recreate-table pattern ensures data integrity during these complex schema updates.

Can I rename a SQLite table that has dependent foreign keys?

Yes, you can rename a SQLite table with dependent foreign keys, but it requires careful migration execution. This Skill guides you through safe rename operations and table recreations to ensure dependent foreign keys remain intact and data consistency is verified.

What are the limitations of SQLite schema migrations for production databases?

SQLite schema migrations face limitations with direct foreign key modifications and complex table alterations. This Skill addresses these constraints by providing decision trees and safe recreate-table patterns to prevent data loss during production database maintenance.