sqlite

Guide safe SQLite database migrations in Rails 8 applications.

Updated Jan 20, 2023
One-click install
npx skills add https://github.com/doncan-orozco/papyro --skill sqlite-doncan-orozco
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sqlite
Source: https://github.com/doncan-orozco/papyro/tree/main/.ai/skills/sqlite
Command: npx skills add https://github.com/doncan-orozco/papyro --skill sqlite-doncan-orozco

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides essential patterns and best practices for managing SQLite database migrations in Rails 8 applications, ensuring data integrity and preventing downtime during schema changes.

Core Features & Use Cases

  • Safe Migration Patterns: Learn how to add, remove, or modify columns and constraints without risking data loss or application errors.
  • Database Maintenance: Understand how to use tools like strong_migrations and database_consistency for auditing and enforcing database health.
  • Use Case: When adding a new status column to your articles table, this Skill guides you through the multi-deploy strategy to safely add the column, backfill data, and eventually remove it without interrupting service.

Quick Start

Use the sqlite skill to add a new column named 'published_at' to the 'articles' table with a datetime type.

Frequently Asked Questions about sqlite

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

FAQPage Schema
How do I safely add a new column to a SQLite database in Rails 8 without downtime?

To safely add a column in SQLite without downtime, use a multi-deploy strategy to add the column, backfill data, and then enforce constraints. This Rails migration pattern prevents application errors by separating schema changes from data updates.

What is the best way to audit SQLite database integrity and schema consistency in Rails?

The best way to audit SQLite database integrity is by using the database_consistency gem. It checks your Rails application models against your SQLite schema to detect missing indexes, constraints, and potential data integrity issues.

Does the strong_migrations gem work with SQLite in Rails 8?

Yes, strong_migrations works with SQLite in Rails 8 to enforce database health. It automatically blocks risky migration operations, guiding you to use safer patterns for column modifications, constraint management, and index creation.

How do I handle data backfilling during a SQLite migration in a Rails application?

Handle SQLite data backfilling by deploying the schema change first, then updating records in batches. This Rails migration strategy ensures data integrity by avoiding locking the database during long-running data updates.

When should I use multi-deploy strategies for SQLite schema changes?

Use multi-deploy strategies for SQLite schema changes when adding constraints or modifying columns in production. This approach minimizes risk by separating schema additions, data backfilling, and constraint enforcement across distinct deployments.