What problem does it solve? Changing a SQLAlchemy model without a matching migration passes the mocked unit suite but breaks on real PostgreSQL, and tightening a validation rule on a JSON-stored field can make existing rows unreadable. This Skill guides safe schema evolution with Alembic so model changes, data backfills, and constraint tightening ship together without breaking production data. ## Core Features & Use Cases - Autogenerate-and-review workflow: Change the model, run alembic revision --autogenerate, then review the draft for chained down_revision, reversible downgrade(), and autogenerate blind spots like enums, JSONB, and server defaults. - Data migrations for narrowed rules: Backfill existing rows in the same revision when a validation rule tightens, so old rows remain readable by Pydantic models. - Multi-tenancy and round-trip testing: Retro-fit organization_id constraints (fill, then constrain, in one revision) and prove migrations with tests/test_migrations.py running the whole chain forwards and back. - Use Case: You add a NOT NULL column to an org-scoped table. The Skill walks you through updating the model, autogenerating the revision, adding the backfill UPDATE before the alter_column(nullable=False), and verifying with a downgrade/upgrade round-trip. ## Quick Start Ask the agent to add a new column to a SQLAlchemy model and generate the corresponding Alembic migration with a round-trip test.