uv run alembic init migrations — Creates the migrations folder and configuration files.
The Development Loop (Every change)
uv run alembic revision --autogenerate -m "description" — Scans your code and writes a new migration script based on changes.
uv run alembic upgrade head — Executes the script to update your actual PostgreSQL database to the latest version.
Maintenance & Undoing
uv run alembic history — Shows the list of all previous migration versions.
uv run alembic current — Shows the version ID your database is currently using.
uv run alembic downgrade -1 — Undoes the very last change and rolls the database back one step.