db-migration

Design and validate database schema changes with up/down migration scripts.

Updated Apr 4, 2026
One-click install
npx skills add https://github.com/asalhamed/dev-agents --skill db-migration-asalhamed
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: db-migration
Source: https://github.com/asalhamed/dev-agents/tree/main/db-migration
Command: npx skills add https://github.com/asalhamed/dev-agents --skill db-migration-asalhamed

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Design and validate database schema changes, write safe migration scripts, and ensure backward compatibility with zero-downtime rollbacks.

Core Features & Use Cases

  • Classify, plan, and implement schema changes (additions, renames, deletions) with up/down migrations.
  • Enforce expand-contract migration strategies, data backfills, and rollback procedures.
  • Coordinate ADR-driven changes between architects and backend developers, DBAs, and deployment pipelines.

Quick Start

Initialize a new migration after the architect defines the schema change in ADR and apply it using the project’s zero-downtime workflow.

Frequently Asked Questions about db-migration

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

FAQPage Schema
How do I plan zero-downtime database schema migrations?

Plan zero-downtime database schema migrations by applying expand-contract strategies, writing idempotent up/down scripts, and validating backward compatibility before deployment. This ensures backward compatibility by separating schema changes into non-breaking expand phases followed by contract phases.

What is an expand-contract migration strategy?

An expand-contract migration strategy is a pattern for evolving database schemas without downtime by expanding the schema with new columns or tables, deploying compatible code, and then contracting the old structure. It ensures backward compatibility throughout the deployment cycle.

How do I write idempotent database migration scripts with rollback support?

Write idempotent database migration scripts by ensuring up and down migration scripts can execute repeatedly without errors, and document rollback procedures for each change. This guarantees safe re-runs and reliable recovery if a deployment fails.

How do I handle data backfills during schema evolution?

Handle data backfills during schema evolution by scripting data migrations alongside schema changes and validating them through an ADR-driven workflow. This coordinates architects, backend developers, and DBAs to ensure data integrity during zero-downtime deployments.

Can this migration approach work across multiple database stacks?

Yes, this database migration approach applies across multi-technology stacks by enforcing standard up/down migration scripts and rollback procedures. It coordinates ADR-driven schema changes regardless of the specific database platform used.

When should I not use an expand-contract database migration?

You should not use an expand-contract database migration when a schema change requires immediate deletion or renaming that breaks backward compatibility, as this pattern relies on transitional compatibility. Complex deletions require careful coordination to avoid breaking active deployments.