new-migration

Create and validate Alembic database migrations with safety checks.

2|Updated Feb 17, 2026
One-click install
npx skills add https://github.com/sumrae412/claude-skills --skill new-migration-sumrae412
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: new-migration
Source: https://github.com/sumrae412/claude-skills/tree/main/new-migration
Command: npx skills add https://github.com/sumrae412/claude-skills --skill new-migration-sumrae412

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a standardized and safe workflow for creating, reviewing, and testing Alembic database migrations, preventing common errors and ensuring data integrity.

Core Features & Use Cases

  • Automated Migration Generation: Creates new Alembic migration files based on a description.
  • Comprehensive Review Checklist: Guides users through critical checks for both upgrade and downgrade functions.
  • Automated Testing: Includes steps to test the migration cycle and verify schema against models.
  • Safety Checks: Emphasizes checks for destructive operations, nullability, and large table modifications.
  • Use Case: A developer needs to add a new column to the users table. This Skill helps them generate the migration, review it for safety (e.g., ensuring a server_default is set for NOT NULL), test the upgrade/downgrade cycle, and even invoke a reviewer agent.

Quick Start

Use the new-migration skill to create a new database migration with the description add_email_to_users_table.

Frequently Asked Questions about new-migration

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

FAQPage Schema
How do I create safe Alembic database migrations in Python?

Safe Alembic database migrations are created by automating migration file generation with built-in safety checks for destructive operations, nullability, and large table modifications. This ensures reversible upgrades and downgrades while maintaining schema consistency with your application models.

What is the best way to add a NOT NULL column to a large database table?

Adding a NOT NULL column to a large database table requires setting a server_default value to prevent data integrity errors. The migration workflow provides specific guidance for data-safe operations and large table modifications to ensure the schema change does not disrupt existing records.

How do I test an Alembic migration upgrade and downgrade cycle?

Testing an Alembic migration upgrade and downgrade cycle involves running automated steps to verify the schema against your application models. This process checks both the upgrade and downgrade functions to ensure the database migration is fully reversible and consistent.

Does this Alembic migration workflow support renaming columns and foreign keys?

Yes, the Alembic migration workflow supports common database schema changes including adding columns, removing columns, creating foreign keys, and renaming columns. It guides you through a comprehensive review checklist to validate these specific operations.

Why do my database migrations fail when dropping columns or foreign keys?

Database migrations often fail during destructive operations like dropping columns or foreign keys if safety checks are bypassed. Using a structured review process catches nullability issues and schema inconsistencies before the migration is applied to the database.

Can I automatically generate Alembic migration files from a schema description?

Yes, you can automatically generate Alembic migration files by providing a description of the required schema change. The generated files include structured upgrade and downgrade functions ready for automated testing and safety validation.