code-add-migration

Plan and generate safe database migrations with change classification and rollout steps.

22|3|Updated Jul 28, 2024
One-click install
npx skills add https://github.com/webdevcody/go-mailing-list --skill code-add-migration
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-add-migration
Source: https://github.com/webdevcody/go-mailing-list/tree/main/.claude/skills/code-add-migration
Command: npx skills add https://github.com/webdevcody/go-mailing-list --skill code-add-migration

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill prevents database migrations from breaking production by forcing you to classify schema changes and follow safe, phased rollout plans.

Core Features & Use Cases

  • Migration tooling detection: Identifies whether your project uses Drizzle, Prisma, Knex, or raw SQL so the right generator/runner is used.
  • Change classification + rollout strategy: Categorizes changes as ADDITIVE, MUTATING, or DESTRUCTIVE and produces the correct multi-step deployment plan.
  • Safety guardrails: Flags common landmines like NOT NULL additions on populated columns, UNIQUE constraints with duplicates, missing CONCURRENTLY for large Postgres indexes, and destructive drops done too early.

Quick Start

Ask the AI to create a safe migration plan and generated steps by describing the schema change you want and what migration tool you use.

Frequently Asked Questions about code-add-migration

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

FAQPage Schema
How do I safely generate database migrations for production?

To safely generate database migrations for production, this Skill detects your project's migration tooling, classifies schema changes as ADDITIVE, MUTATING, or DESTRUCTIVE, and produces a structured report with phased rollout commands and reversal considerations.

How do I add a NOT NULL column to a populated Postgres table without downtime?

Adding a NOT NULL column to a populated Postgres table requires a multi-step approach to avoid downtime. This Skill flags NOT NULL additions as landmines and generates a phased rollout plan to backfill data and apply the constraint safely.

Can I use this to generate migrations for Drizzle, Prisma, and Knex?

Yes, this Skill works with Drizzle, Prisma, Knex, and raw SQL. It automatically detects your project's migration tooling to ensure the correct generator and runner are used for your specific schema modifications.

What is the best way to create large Postgres indexes without locking the database?

Creating large Postgres indexes without locking the database requires using the CONCURRENTLY keyword. This Skill enforces concurrency-aware safety checks and coordinates deploy steps to prevent missing this critical flag.

How do I handle destructive schema changes like dropping columns safely?

Handling destructive schema changes like dropping columns safely requires classifying them as DESTRUCTIVE and delaying the drop. This Skill produces a structured report with phased rollout guidance to ensure destructive drops are not executed too early.