Alembic Cheatsheet 01 — Setup and env.py

Cheatsheet: alembic init, env.py wiring for SQLAlchemy 2.0, async env.py, naming conventions.

May 15, 2026 · 2 min · 357 words · Manvendra Rajpoot

Alembic Textbook Ch. 1 — Introduction and Setup

Alembic basics: setup with SQLAlchemy 2.0, env.py for sync/async, naming conventions, the migration directory.

May 10, 2026 · 3 min · 578 words · Manvendra Rajpoot

Alembic Cheatsheet 02 — Commands

Cheatsheet: complete list of alembic CLI commands with flags and common scenarios.

May 15, 2026 · 3 min · 483 words · Manvendra Rajpoot

Alembic Textbook Ch. 2 — Autogenerate: What It Sees, What It Misses

What Alembic autogenerate detects (tables, columns, indexes, constraints) and what it doesn’t (data migrations, complex changes, defaults), plus a review checklist.

May 10, 2026 · 3 min · 635 words · Manvendra Rajpoot

Alembic Cheatsheet 03 — Autogenerate

Cheatsheet: autogenerate detection rules, common misses (renames, data, defaults), drift detection.

May 15, 2026 · 3 min · 471 words · Manvendra Rajpoot

Alembic Textbook Ch. 3 — Writing Migrations Manually

Manual migrations: op API, ALTER patterns, batch ops for SQLite, data migrations, idempotent migrations.

May 10, 2026 · 4 min · 752 words · Manvendra Rajpoot

Integration Cheatsheet 04 — Alembic + FastAPI Workflow

Cheatsheet: model change → autogenerate → review → upgrade → ship.

May 16, 2026 · 3 min · 584 words · Manvendra Rajpoot

Alembic Cheatsheet 04 — op API Reference

Cheatsheet: op.create_table / drop / add_column / alter_column / indexes / constraints / FKs / raw SQL.

May 15, 2026 · 3 min · 439 words · Manvendra Rajpoot

Alembic Textbook Ch. 4 — Branching, Merging, and Multiple Heads

Alembic branching: how multiple revisions create branches, merging strategies, and team workflows.

May 10, 2026 · 3 min · 592 words · Manvendra Rajpoot

Alembic Cheatsheet 05 — Online (Zero-Downtime) Schema Changes

Cheatsheet: expand-contract pattern, CONCURRENTLY index, FK validation in two phases, batched backfill.

May 15, 2026 · 3 min · 584 words · Manvendra Rajpoot