Integrates Alembic database migrations with Flask applications. Current stable version 3.2.0, released 2025-10-15. Supports Flask-SQLAlchemy, Flask-SQLAlchemy-Lite, and plain SQLAlchemy. Python >=3.10 required.
pip install flask-alembicVerified import paths — ran on the pinned version, not inferred.
Initialize Alembic, create first migration, and apply it.
Update Python to 3.8+ and pip install flask-alembic>=3.0
Change import to `from flask_alembic import Alembic` and instantiate `Alembic(app)`
Pass `metadatas` dict to `Alembic(app, metadatas={'db1': metadata1})`Use `flask db` commands only after configuring the Flask app (e.g., via `FLASK_APP` env var).
Remove `command_name` from Alembic() call.
Replace `from flask_alembic import FlaskAlembic` with `from flask_alembic import Alembic`.
Ensure your custom env.py imports your SQLAlchemy models and sets `target_metadata` correctly.
Wrap code in `with app.app_context():` or use `flask shell` to run commands interactively.