migration-helper

Automate Alembic database migrations with upgrade/downgrade templates and rollback support.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/sage-base/sagebase --skill migration-helper-sage-base
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: migration-helper
Source: https://github.com/sage-base/sagebase/tree/main/.claude/skills/migration-helper
Command: npx skills add https://github.com/sage-base/sagebase --skill migration-helper-sage-base

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill streamlines and standardizes Alembic-based database migrations for Sagebase, reducing schema drift and minimizing risky manual changes.

Core Features & Use Cases

  • Migration creation: generate new migration files with safe boilerplate and consistent structure.
  • Schema changes & rollback: provide upgrade/downgrade templates and ensure reliable rollbacks across environments.
  • Operational integration: supports Docker and local setups for applying migrations with a clear CLI workflow.

Quick Start

Just run:

  • just migrate-new "add_email_to_politicians"
  • docker compose exec sagebase uv run alembic revision -m "add_email_to_politicians"
  • sagebase migrate or just migrate to apply migrations

Frequently Asked Questions about migration-helper

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

FAQPage Schema
How do I create a new Alembic migration file for a PostgreSQL schema change?

To create a new Alembic migration, you can use the standardized CLI workflow like `just migrate-new` or run `alembic revision` to generate a file with safe boilerplate and consistent upgrade/downgrade structure.

What is the best way to ensure safe rollback support during database migrations?

Safe rollback support is enforced by generating migration files with standardized upgrade and downgrade templates, ensuring reliable schema reversal across Docker and local environments.

Can I apply Alembic migrations inside a Docker compose environment?

Yes, you can apply Alembic migrations inside Docker by running `docker compose exec sagebase uv run alembic upgrade` or using the `just migrate` command for a clear CLI workflow.

How does automating Alembic migrations prevent schema drift?

Automating Alembic migrations prevents schema drift by standardizing migration file creation and enforcing best practices for schema alterations, table additions, and column changes across all environments.

Do I need a specific CLI setup to add new columns and indexes with Alembic?

You need a local or Docker setup with Alembic installed to add columns and indexes, utilizing the provided CLI commands to ensure safe boilerplate generation and consistent migration structure.