database-migrations

Execute safe, reversible database schema migrations across PostgreSQL and MySQL.

Updated Mar 16, 2026
One-click install
npx skills add https://github.com/Clean1ines/crm_bot --skill database-migrations-clean1ines
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-migrations
Source: https://github.com/Clean1ines/crm_bot/tree/main/.agents/skills/ecc/database-migrations
Command: npx skills add https://github.com/Clean1ines/crm_bot --skill database-migrations-clean1ines

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Safe, reversible database migrations prevent production outages and drift by enforcing best practices for schema changes, data moves, and rollback plans.

Core Features & Use Cases

  • Migration safety checklist, including UP/DOWN requirements, non-locking changes, and data backfills.
  • Patterns for zero-downtime changes (expand-contract, concurrent indexes) across PostgreSQL, MySQL, and ORM tools (Prisma, Drizzle, Kysely, Django, golang-migrate).
  • Use cases include adding columns with defaults, backfilling data, and safely removing deprecated fields.

Quick Start

Create a new migration with your tool of choice, then run it first in staging with a backfill plan and monitor for issues before production.

Frequently Asked Questions about database-migrations

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

FAQPage Schema
How do I perform zero-downtime database migrations in production?

Zero-downtime database migrations use the expand-contract pattern to separate schema changes from data backfills, ensuring concurrent operations do not lock production tables. This approach applies non-locking schema alterations across PostgreSQL and MySQL to maintain continuous availability.

What is the safest way to backfill data when adding columns with defaults?

The safest way to backfill data when adding columns with defaults is to separate the data migration from the schema alteration, batching the backfill to avoid locking. This process runs first in staging to monitor issues before executing the production database migration.

Does this database migration approach work with Prisma and Django ORM layers?

Yes, this database migration approach works with Prisma, Django, Drizzle, Kysely, and golang-migrate ORM layers. It provides patterns for concurrent indexes and reversible schema changes that integrate directly with these specific ORM tools.

How do I write reversible UP and DOWN migrations for schema changes?

Writing reversible UP and DOWN migrations requires defining a rollback plan for every schema alteration and data move. This enforces migration safety by ensuring each deployment process includes tested, auditable DOWN migrations that reverse the exact changes applied.

Why do database migrations cause production outages and how can I prevent them?

Database migrations cause production outages when schema changes lock tables or break application compatibility. Prevent production drift and downtime by applying a migration safety checklist with non-locking changes, concurrent operations, and separate data migrations across PostgreSQL and MySQL.