db-migration

Automate Alembic database migrations for SQLModel/FastAPI projects.

Updated Jan 10, 2026
One-click install
npx skills add https://github.com/Awais68/h2_phase_3_Chatbot_Todo --skill db-migration-awais68
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: db-migration
Source: https://github.com/Awais68/h2_phase_3_Chatbot_Todo/tree/main/.claude/skills/db-migration
Command: npx skills add https://github.com/Awais68/h2_phase_3_Chatbot_Todo --skill db-migration-awais68

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill automates safe Alembic migration management for SQLModel/FastAPI projects, ensuring predictable schema evolution and robust rollback.

Core Features & Use Cases

  • Initialize Alembic in a project to enable migrations
  • Generate and manage migrations (including autogenerate) with clear versioning
  • Apply upgrades/downgrades safely and support data migrations

Quick Start

Initialize Alembic in your project with alembic init alembic. Create a new migration with alembic revision --autogenerate -m "describe_change". Apply migrations using alembic upgrade head. Rollback with alembic downgrade base.

Frequently Asked Questions about db-migration

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

FAQPage Schema
How do I set up Alembic database migrations for a FastAPI and SQLModel project?

To set up database migrations for a FastAPI and SQLModel project, initialize Alembic using the alembic init command, then configure it to integrate with SQLModel metadata for autogenerating schema revisions.

Can I autogenerate Alembic migration revisions from SQLModel metadata?

Yes, you can autogenerate Alembic migration revisions directly from SQLModel metadata by running the alembic revision --autogenerate command, which detects schema changes and creates corresponding version scripts.

What is the best way to rollback a database migration in a production FastAPI environment?

The best way to rollback a database migration in production is to use the alembic downgrade command, which this skill enforces with safe, idempotent rollback guidance to ensure predictable schema evolution.

Does this Alembic migration skill handle data migrations alongside schema evolution?

Yes, this Alembic migration skill handles data migrations alongside schema evolution by providing templates for common scenarios, ensuring safe upgrades and downgrades across evolving schemas in development and production.

Why are my Alembic migrations failing during schema evolution in SQLModel?

Alembic migrations may fail during SQLModel schema evolution if not properly integrated with metadata or if migrations lack idempotency; this skill provides safe templates and rollback guidance to prevent such issues.