database-migrations

Plan safe, reversible database migrations for production systems.

46|8|Updated Mar 25, 2026
One-click install
npx skills add https://github.com/manikosto/claude-code-python-stack --skill database-migrations-manikosto
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-migrations
Source: https://github.com/manikosto/claude-code-python-stack/tree/main/skills/database-migrations
Command: npx skills add https://github.com/manikosto/claude-code-python-stack --skill database-migrations-manikosto

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Safe, reversible database schema changes to production systems, preventing downtime and data loss.

Core Features & Use Cases

  • Migration Safety: forward-only deployment with clean UP/DOWN scripts or reversible design.
  • Platform Coverage: Alembic (SQLAlchemy), Django migrations, and raw SQL examples for complex changes.
  • Use Case: Apply a new non-nullable column by adding it with a default, backfilling data in a separate step to avoid table locks.

Quick Start

Plan and execute a safe, zero-downtime database migration for a given schema change.

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 involve planning safe, reversible schema changes using forward-only deployments with clean UP/DOWN scripts. You apply best practices across Alembic, Django, and raw SQL to prevent table locks and ensure continuous availability.

What is the best way to add a non-nullable column without locking the database?

The best way to add a non-nullable column without locking the database is to add it with a default value first, then backfill the data in a separate step. This zero-downtime strategy prevents long table locks during production migrations.

Can I plan reversible database migrations for both Django and raw SQL?

Yes, you can plan reversible database migrations for both Django and raw SQL. The approach covers platform-specific best practices for Alembic, Django, and raw SQL, ensuring compatibility with existing schemas and data across a variety of environments.

How do you document validation checks and rollback plans for SQL migrations?

Documenting validation checks and rollback plans for SQL migrations involves detailing every migration step and safety measure. You generate documentation that ensures compatibility with existing schemas and provides clear reversal paths to prevent data loss.

When should I use data migrations instead of standard schema migrations?

You should use data migrations when you need to backfill or transform existing data separately from schema changes to avoid table locks. Planning these data migrations as distinct steps ensures safe, zero-downtime updates in production systems.