new-migration

Create paired SQL migration files with a six-digit numeric prefix.

Updated Mar 25, 2026
One-click install
npx skills add https://github.com/guarzo/slabledger --skill new-migration-guarzo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: new-migration
Source: https://github.com/guarzo/slabledger/tree/main/.claude/skills/new-migration
Command: npx skills add https://github.com/guarzo/slabledger --skill new-migration-guarzo

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Create a pair of SQL migration files (up and down) to modify the database schema safely and reversibly.

Core Features & Use Cases

  • Automates the creation of a two-file migration pair named with a six-digit numeric prefix and a short snake_case description
  • Enforces the reversible migration workflow by pairing Up and Down SQL scripts and standardizing file naming
  • Guides developers through a deterministic, testable migration process

Quick Start

Run this skill to generate the next migration pair in the migrations directory.

Frequently Asked Questions about new-migration

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

FAQPage Schema
How do I create reversible database migrations with up and down SQL scripts?

To create reversible database migrations, generate a paired up and down SQL script set. This ensures schema changes can be safely applied and rolled back, standardizing the migration process for deterministic, testable database updates.

What naming convention should I use for SQL schema change files?

The naming convention for SQL schema change files is a six-digit numeric prefix followed by a short snake_case description, using the NNNNNN_short_description.{up,down}.sql format. This standardizes file tracking and ensures proper migration ordering.

How do I determine the next migration number for my database schema changes?

To determine the next migration number for database schema changes, evaluate the existing migration files in your directory. The workflow enforces sequential six-digit numeric prefixes to maintain strict version control over applied database migrations.

Does the migration process include validation after writing up and down scripts?

Yes, the migration process includes running validations after writing up and down scripts. Beyond generating the SQL file pair, the workflow guides you through embedding migrations, updating documentation, and executing validation checks to ensure schema safety.

Why do I need a down migration script for every database schema change?

A down migration script is required for every database schema change to ensure reversibility. Pairing up and down SQL scripts allows you to safely roll back modifications if an error occurs, maintaining a deterministic and testable database state.

Can I use this migration workflow without any external database dependencies?

Yes, you can use this migration workflow without external database dependencies. The process operates independently to generate the up and down SQL files, enforce naming conventions, and guide documentation updates for your version-controlled schema changes.