database-migration

Generate and apply Alembic migrations for SQLAlchemy models in Neon environments.

34|1|Updated Mar 17, 2026
One-click install
npx skills add https://github.com/earayu/treadstone --skill database-migration-earayu
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-migration
Source: https://github.com/earayu/treadstone/tree/main/.agents/skills/database-migration
Command: npx skills add https://github.com/earayu/treadstone --skill database-migration-earayu

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This metadata describes a repeatable, auditable workflow for designing database models and managing Alembic migrations for the Treadstone project, preventing ad-hoc schema changes and drift.

Core Features & Use Cases

  • Design and register SQLAlchemy models in treadstone/models with proper Base wiring and import in init to enable migrations.
  • Generate, review, and apply Alembic migrations through a defined pipeline from model changes to test branches and production environments.
  • Safely manage migrations in Neon test branches with rollback support and repeatable deployment practices.

Quick Start

Run make migration MSG="describe-change" to generate and review the migration, then apply it to Neon.

Frequently Asked Questions about database-migration

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

FAQPage Schema
How do I generate and apply Alembic migrations for SQLAlchemy models?

Generate Alembic migrations by running `make migration MSG="describe-change"`, reviewing the output, and applying the schema changes to a Neon test branch before promoting to production.

What is the workflow for managing SQLAlchemy database migrations in Neon test branches?

Managing SQLAlchemy migrations in Neon test branches involves designing models, generating Alembic migrations, applying them with rollback support, and reviewing schema changes before production deployment.

Do I need a specific project structure to use Alembic migrations with SQLAlchemy?

You need to register SQLAlchemy models in `treadstone/models` with proper Base wiring and import them in `__init__` to enable Alembic migration generation.

How to prevent database schema drift when modifying SQLAlchemy models?

Prevent database schema drift by using a defined Alembic migration pipeline that enforces review before applying schema changes, eliminating ad-hoc database modifications.

Can I roll back Alembic migrations in a Neon database branch?

Yes, you can safely manage and roll back Alembic migrations in Neon test branches, allowing repeatable deployment practices and schema change reversion.

What are the limitations of using a defined migration pipeline for SQLAlchemy?

The defined migration pipeline requires Python, SQLAlchemy, Alembic, and a strict review process before applying migrations, which may constrain rapid prototyping or ad-hoc schema modifications.