database-migration

database-migration is a skill for Claude Code from bobmatnyc/claude-mpm-skills. It costs 19 tokens per session (1,568 once invoked), scanned A, original, MIT.

A guide to changing a live database’s structure safely while keeping the application running. It covers steps such as adding fields, moving existing data, and removing old fields.

In plain words
What is it for?
Use it when adding, renaming, or removing database fields and indexes in production systems.
Why use it?
Database changes can break running code or cause downtime if made all at once. This guide helps you introduce changes gradually, test them, and keep a rollback path.

Skill for Claude Code

Written for Claude Code: disable-model-invocation in frontmatter.

not rated 74repo 1mo ago A scan Socket: passSnyk: passSkillSpector: pass 19 tokens original MIT

Good fit Use it when adding, renaming, or removing database fields and indexes in production systems.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/bobmatnyc/claude-mpm-skills/database-migration
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add bobmatnyc/claude-mpm-skills --skill database-migration
Clone the repo
git clone --depth 1 https://github.com/bobmatnyc/claude-mpm-skills

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for database-migration

README.md
[![agentmods](https://agentmods.dev/badge/skills/bobmatnyc/claude-mpm-skills/database-migration/github.svg)](https://agentmods.dev/skills/bobmatnyc/claude-mpm-skills/database-migration)
Your own site
<a href="https://agentmods.dev/skills/bobmatnyc/claude-mpm-skills/database-migration"><img src="https://agentmods.dev/badge/skills/bobmatnyc/claude-mpm-skills/database-migration/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for database-migration

Your own site · 80×15
<a href="https://agentmods.dev/skills/bobmatnyc/claude-mpm-skills/database-migration"><img src="https://agentmods.dev/badge/skills/bobmatnyc/claude-mpm-skills/database-migration.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 19 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,568 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Socket pass 4 May 2026
  • Snyk pass 4 May 2026
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00019 $0.01568
Opus 5 $0.00010 $0.00784
Sonnet 5 $0.00004 $0.00314
Haiku 4.5 $0.00002 $0.00157

Measured 6d ago against content hash 8de9bdc3a881, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

database-migration scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

universal/data/database-migration/SKILL.md · 261 lines

How it starts

The opening of the file, as written. The whole thing — 261 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Database Migration

Safe patterns for evolving database schemas in production.

Migration Principles

  1. Backward compatible - New code works with old schema
  2. Reversible - Can rollback if needed
  3. Tested - Verify on staging before production
  4. Incremental - Small changes, not big-bang
  5. Zero downtime - No service interruption

Safe Migration Pattern

Phase 1: Add New (Compatible)

-- Add new column (nullable initially)
ALTER TABLE users ADD COLUMN full_name VARCHAR(255) NULL;

-- Deploy new code that writes to both old and new
UPDATE users SET full_name = CONCAT(first_name, ' ', last_name);

Phase 2: Migrate Data

-- Backfill existing data
UPDATE users
SET full_name = CONCAT(first_name, ' ', last_name)
WHERE full_name IS NULL;

Phase 3: Make Required

-- Make column required
ALTER TABLE users ALTER COLUMN full_name SET NOT NULL;

Phase 4: Remove Old (After New Code Deployed)

-- Remove old columns
ALTER TABLE users DROP COLUMN first_name;
ALTER TABLE users DROP COLUMN last_name;

Common Migrations

Adding Index

-- Create index concurrently (PostgreSQL)
CREATE INDEX CONCURRENTLY idx_users_email ON users(email);

Renaming Column

-- Phase 1: Add new column
ALTER TABLE users ADD COLUMN email_address VARCHAR(255);

-- Phase 2: Copy data
UPDATE users SET email_address = email;

-- Phase 3: Drop old column (after deploy)
ALTER TABLE users DROP COLUMN email;

Changing Column Type

-- Phase 1: Add new column with new type
ALTER TABLE products ADD COLUMN price_cents INTEGER;

-- Phase 2: Migrate data
UPDATE products SET price_cents = CAST(price * 100 AS INTEGER);

-- Phase 3: Drop old column
ALTER TABLE products DROP COLUMN price;
ALTER TABLE products RENAME COLUMN price_cents TO price;

Adding Foreign Key

-- Add column first
ALTER TABLE orders ADD COLUMN user_id INTEGER NULL;

-- Populate data
UPDATE orders SET user_id = (
    SELECT id FROM users WHERE users.email = orders.user_email
);

-- Add foreign key
ALTER TABLE orders
ADD CONSTRAINT fk_orders_users
FOREIGN KEY (user_id) REFERENCES users(id);

Read the full file on GitHub · 261 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 261 lines · 19 tokens per session scan A 8de9bdc3a881

Subscribe to this mod's changes

database-migration is a skill published in the GitHub repository bobmatnyc/claude-mpm-skills (74 stars, last pushed 1mo ago), licensed MIT. It adds 19 tokens to every session and 1,568 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

Database Migration Testing

Testing database migration scripts for correctness, rollback safety, data integrity, and zero-downtime migration patterns.

PramodDutta/qaskills · 25 tokens

db-migration-safety

Ship schema changes with zero downtime and clean rollback. Invoke before any ALTER TABLE, new column, new index, or data backfill on a production database.

orlando-japan/claude-code-setting · 37 tokens

db-migrations

Use when a schema change must ship without downtime — NOT NULL, rename, type change, or backfilling millions of live rows — for the expand-contract sequence and the lock/batching discipline that keeps each step from freezing prod. NOT lock internals or EXPLAIN (that is postgresdb), NOT drizzle-kit mechanics (that is…

ericrisco/rsc-harness · 90 tokens

database-migration-patterns

Manage database schema changes safely with migration tools, zero-downtime strategies, and rollback procedures. Covers Alembic, SQL migrations, data migrations, and testing strategies. Triggers on database migration, schema changes, or Alembic configuration requests.

organvm-iv-taxis/a-i--skills · 56 tokens

Migration Safety Review (framework-agnostic)

A framework-independent review guide for database and data migrations. A migration is a controlled change to database structure or existing data, such as adding, changing, or removing a column.

s977043/river-review · 89 tokens

Data Model & DB Design Review

Ensure data model/DB designs cover constraints, integrity, indexes, migrations, rollback, and operational impacts.

s977043/river-review · 28 tokens