py-migrate

Autogenerate reversible PostgreSQL schema migrations from SQLAlchemy models with Alembic.

3|Updated Mar 22, 2026
One-click install
npx skills add https://github.com/vndee/engineering-skills --skill py-migrate
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: py-migrate
Source: https://github.com/vndee/engineering-skills/tree/main/.claude/skills/py-migrate
Command: npx skills add https://github.com/vndee/engineering-skills --skill py-migrate

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Safe, reversible PostgreSQL schema changes driven by models in Alembic with SQLAlchemy 2.0 async, ensuring migrations are reviewable and testable.

Core Features & Use Cases

  • Model-driven migrations: autogenerate migrations from SQLAlchemy models and enforce review.
  • Safe DDL patterns: apply changes with zero-downtime strategies and careful rollback.
  • Async workflow integration: supports async environment configuration and Python tooling for migrations.
  • Use Case: When you need to evolve your database schema safely across environments with predictable migrations.

Quick Start

Update your SQLAlchemy models, then run alembic revision --autogenerate and alembic upgrade head to apply the migration.

Frequently Asked Questions about py-migrate

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

FAQPage Schema
How do I autogenerate Alembic migrations from SQLAlchemy 2.0 models?

You autogenerate Alembic migrations by updating your SQLAlchemy 2.0 models and running alembic revision --autogenerate. This enforces models as truth, creating reviewable migration scripts reflecting PostgreSQL schema changes.

Can I perform reversible PostgreSQL schema migrations asynchronously?

Yes, you can perform reversible PostgreSQL schema migrations asynchronously. The workflow supports SQLAlchemy 2.0 async configuration, applying safe DDL patterns with careful rollback capabilities for predictable schema evolution.

What is the best way to ensure zero-downtime database schema changes in Python?

The best way to ensure zero-downtime database schema changes is using a model-driven approach with safe DDL patterns. This applies changes carefully and ensures full reversibility through predictable, testable migration workflows.

Does this migration workflow support data migrations alongside schema changes?

Yes, this migration workflow supports data migrations alongside schema changes. It handles adding or modifying models, creating tables, and migrating data within a full Alembic and SQLAlchemy migration workflow.

How do I apply and rollback a migration in an async PostgreSQL environment?

You apply a migration by running alembic upgrade head in your async environment. The workflow uses safe DDL patterns to apply changes and provides careful rollback mechanisms to reverse PostgreSQL schema modifications predictably.