alembic-migrations

Automate SQLAlchemy schema migrations with Alembic revision generation and rollbacks.

Updated Jan 17, 2026
One-click install
npx skills add https://github.com/linsomniac/smtphotel --skill alembic-migrations
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: alembic-migrations
Source: https://github.com/linsomniac/smtphotel/tree/main/.claude/skills/alembic
Command: npx skills add https://github.com/linsomniac/smtphotel --skill alembic-migrations

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Automates database schema migrations for SQLAlchemy projects using Alembic to version, apply, and rollback structural changes safely.

Core Features & Use Cases

  • Auto-generate migrations from model changes using alembic revision --autogenerate.
  • Review and refine migration scripts to ensure constraints, indexes, and defaults are correct.
  • Apply migrations to upgrade or downgrade databases across environments, with history tracked.

Quick Start

Run Alembic migrations locally to create, upgrade, or downgrade your database schema.

Frequently Asked Questions about alembic-migrations

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

FAQPage Schema
How do I auto-generate database migrations from SQLAlchemy model changes?

You can auto-generate database migrations from SQLAlchemy model changes using the alembic revision --autogenerate command. This creates versioned revision scripts that detect table, index, and constraint modifications to apply schema upgrades safely.

Why use Alembic for SQLAlchemy schema versioning instead of raw SQL scripts?

Alembic provides reliable schema versioning for SQLAlchemy by tracking migration history and enabling controlled upgrades and rollbacks. Unlike raw SQL scripts, it auto-generates revision scripts from model changes and maintains a schema reference across environments.

How do I rollback a database migration in SQLAlchemy?

To rollback a database migration in SQLAlchemy, you apply Alembic downgrade scripts. The migration workflow supports downgrading databases across environments by applying versioned revision scripts that reverse structural changes like tables, indexes, or constraints.

Can I review and refine auto-generated Alembic migration scripts before applying them?

Yes, the Alembic migration workflow includes reviewing and refining auto-generated migration scripts. You can inspect the generated revisions to ensure constraints, indexes, and defaults are correct before applying upgrades or downgrades to the database.

When do I need to run a database schema migration for SQLAlchemy projects?

You need to run a database schema migration for SQLAlchemy projects when development workflows create or modify tables, indexes, or constraints. Alembic applies these structural changes across environments, enabling versioned upgrades and reliable rollbacks.

Does Alembic support tracking schema changes across multiple environments?

Yes, Alembic supports tracking schema changes across multiple environments. It applies versioned upgrades and downgrades to databases in different settings, keeping a history of applied revisions and maintaining a tracked schema reference.