aidog-db-migration

Create forward-only SQLite migrations for Aidog schema changes.

7|1|Updated Jun 12, 2026
One-click install
npx skills add https://github.com/lazygophers/aidog --skill aidog-db-migration
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: aidog-db-migration
Source: https://github.com/lazygophers/aidog/tree/main/.claude/skills/aidog-db-migration
Command: npx skills add https://github.com/lazygophers/aidog --skill aidog-db-migration

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill removes the risk and guesswork from changing Aidog's local SQLite schema, especially when you need to add tables, add columns, change constraints, split fields, or rebuild tables without breaking existing user databases.

Core Features & Use Cases

  • Forward-only migrations: Follows Aidog's validated migration style with numbered, append-only SQL files and no rollback path.
  • SQLite rebuild patterns: Handles schema changes SQLite cannot do in place, such as adding UNIQUE constraints or renaming and splitting columns.
  • Compatibility safeguards: Keeps migrations idempotent, adds defaults for new columns, filters conflict-prone legacy rows, and preserves indexes during table rebuilds.
  • Use case: Update Aidog's database to introduce a new schema field or enforce a new constraint while keeping existing installations working during startup migration.

Quick Start

Ask the assistant to create the next Aidog SQLite migration for a specific schema change and update the related Rust database code paths in sync.

Frequently Asked Questions about aidog-db-migration

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

FAQPage Schema
How do I add a UNIQUE constraint to an existing SQLite column without losing user data?

To add a UNIQUE constraint in SQLite, you must use a table rebuild pattern. This involves creating a new table with the desired schema, copying data while filtering conflicting legacy rows, and preserving indexes during the rebuild to safely evolve the schema.

What is a forward-only SQLite migration and when do I need it?

A forward-only SQLite migration uses numbered, append-only SQL files without a rollback path. You need this approach for embedded database upgrades to preserve existing user data and safely handle legacy rows automatically during startup.

How do I split a database column in SQLite while keeping existing installations working?

To split a column in SQLite, use a rebuild-table pattern to rename and restructure the fields. You must synchronize updates to the database code paths and related models to ensure existing installations continue working during the startup migration.

Do I need to specify DEFAULT values when adding columns to an existing SQLite table?

Yes, you must add DEFAULT values for new columns when evolving an SQLite schema. This compatibility safeguard ensures the migration remains idempotent and prevents errors when existing legacy rows are upgraded automatically at startup.

What is the best way to automate SQLite schema changes for an embedded database at startup?

The best way to automate embedded SQLite schema changes is applying numbered, forward-only SQL migrations at startup. This safely evolves the schema, handles legacy rows, and preserves user data without requiring manual intervention.

Why does adding a new schema field require updating Rust database code paths?

Adding a new schema field requires updating Rust database code paths to maintain synchronization between the database and the application. This ensures the embedded SQLite migration runs correctly and the application models reflect the new schema constraints.