database-migration

Manage and apply Alembic database migrations with rollback and testing.

10|5|Updated Dec 12, 2025
One-click install
npx skills add https://github.com/ils15/mythic-agents --skill database-migration-ils15
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-migration
Source: https://github.com/ils15/mythic-agents/tree/main/skills/database-migration
Command: npx skills add https://github.com/ils15/mythic-agents --skill database-migration-ils15

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Database migrations are error-prone when changing schemas in production. This skill provides a structured workflow to generate, review, test, and deploy migrations safely using Alembic, ensuring traceability and rollback paths.

Core Features & Use Cases

  • Versioned migrations: Generate and manage forward migrations with built-in rollback capability.
  • Testing discipline: Local and production-like tests verify data integrity before deployment.
  • Zero-downtime deployment: Strategies like Expand-Contract and Blue-Green minimize live impact and ensure smooth transitions.

Quick Start

  • Generate a migration with alembic revision --autogenerate -m "Add user preferences"
  • Review the generated script in alembic/versions
  • Apply the migration in a staging environment and validate results
  • Deploy to production following the chosen zero-downtime strategy

Frequently Asked Questions about database-migration

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

FAQPage Schema
How do I perform zero-downtime database migrations with Alembic?

Zero-downtime database migrations with Alembic use strategies like Expand-Contract and Blue-Green to apply schema changes without live impact. This workflow enforces versioned scripts, staging validation, and rollback procedures to ensure predictable deployments.

What is the best way to test SQL migrations before deploying to production?

Testing SQL migrations involves applying scripts in local and production-like staging environments to verify data integrity before deployment. This workflow enforces a testing discipline that validates forward migrations and rollback capabilities against production-like data.

Can I roll back an Alembic migration if a production deployment fails?

You can roll back an Alembic migration using built-in rollback capabilities provided by versioned migration scripts. The workflow ensures backward compatibility by defining and testing rollback procedures in staging environments before production deployment.

How does the Expand-Contract pattern work for zero-downtime schema changes?

The Expand-Contract pattern for zero-downtime schema changes minimizes live impact by separating deployment into backward-compatible phases. This workflow uses Expand-Contract and Blue-Green strategies to ensure smooth transitions and predictable deployments.

How do I generate and review Alembic migration scripts for schema changes?

Generating Alembic migration scripts uses the autogenerate command to create versioned files for schema changes. The workflow requires reviewing the generated script in the versions directory and validating results in a staging environment before deployment.