alembic

Automate SQLAlchemy database migrations with Alembic revision generation and upgrades.

11|2|Updated Feb 18, 2026
One-click install
npx skills add https://github.com/the-perfect-developer/the-perfect-opencode --skill alembic-the-perfect-developer
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: alembic
Source: https://github.com/the-perfect-developer/the-perfect-opencode/tree/main/.opencode/skills/alembic
Command: npx skills add https://github.com/the-perfect-developer/the-perfect-opencode --skill alembic-the-perfect-developer

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Alembic provides a reliable framework to manage database schema changes in SQLAlchemy projects, tracking versions and applying migrations safely.

Core Features & Use Cases

  • Initialize the migration environment and create revision scripts.
  • Autogenerate migrations from model changes and manage upgrades/downgrades.
  • Configure database URLs, offline/online modes, and environment-specific behavior.

Quick Start

Initialize Alembic, generate your first revision, and apply migrations to your database.

Frequently Asked Questions about alembic

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

FAQPage Schema
How do I manage SQLAlchemy database schema migrations?▼

You can manage SQLAlchemy database migrations by using Alembic to track schema versions, autogenerate revision scripts from model changes, and safely apply upgrades or downgrades.

How do I autogenerate database revisions from SQLAlchemy model changes?▼

Autogenerating database revisions involves initializing the Alembic environment, detecting SQLAlchemy model modifications, and creating migration scripts to apply those schema upgrades automatically.

Can I configure Alembic using a pyproject.toml file instead of alembic.ini?▼

Yes, Alembic supports both ini and pyproject-based configurations, allowing you to define database URLs, offline or online modes, and environment-specific behavior within your preferred project setup.

What is the best way to handle database downgrades in SQLAlchemy?▼

Handling database downgrades requires generating revision scripts through Alembic, which tracks schema versions and provides controlled commands to revert your SQLAlchemy database to a previous state safely.

Do I need to initialize a migration environment before applying schema upgrades?▼

Yes, you must initialize the Alembic migration environment first to establish configuration files and scripts before generating revisions and applying schema upgrades to your SQLAlchemy database.