Flask-Migrate
SQLAlchemy database migrations for Flask applications using Alembic.
What it is and what it does
Flask-Migrate is a Flask extension that wraps Alembic to manage SQLAlchemy database schema changes. It exposes migration operations through the `flask db` command-line interface, letting you initialize migrations, generate migration scripts from model changes, and apply those changes to your database. The package integrates directly with Flask and Flask-SQLAlchemy, so you initialize it by passing your app and database instance to the Migrate class.
The typical workflow is: run `flask db init` once to set up a migrations folder, then `flask db migrate` each time your models change (which generates a migration script you should review), and `flask db upgrade` to apply pending migrations to your database. Migration scripts are meant to be version-controlled alongside your source code. The package is actively maintained, has no known vulnerabilities, and depends only on Flask, Flask-SQLAlchemy, and alembic.
Use it for:
- Track and version database schema changes alongside your Flask application code in Git.
- Automate deployment of schema changes across development, staging, and production environments.
- Collaborate on database changes in a team by sharing migration scripts through version control.
- Rollback or replay database changes by running specific migration scripts in sequence.
- Initialize a new Flask application with an empty database and a migrations folder ready for future changes.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Flask-Migrate handles SQLAlchemy database migrations for Flask applications using Alembic, exposing migration operations as `flask db` command-line commands.
Yes. Flask-Migrate is the standard, actively maintained tool for database migrations in Flask applications. It has low install friction, no security vulnerabilities, permissive licensing, and solves a core problem in Flask development. Install it if you are building a Flask app with SQLAlchemy and need to manage schema changes over time.
Install
flask-migrate on PyPI
pip
pip install flask-migrateuv
uv add flask-migratepoetry
poetry add flask-migrateInstalling Flask-Migrate
Before you install
Low friction: pure Python wheel, only three runtime dependencies (Flask, Flask-SQLAlchemy, alembic). Actively maintained with recent releases and a stable repository.
License in practice
MIT license is permissive; you can use, modify, and distribute Flask-Migrate with minimal restrictions, including in commercial applications.
Quickstart
pip install Flask-Migrate
from flask_migrate import Migrate
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
app = Flask(__name__)
db = SQLAlchemy(app)
migrate = Migrate(app, db)
# Then run: flask db init, flask db migrate, flask db upgrade
FLASK_APP environment variable must be set for flask db commands to work, as documented in Flask.
Verify before relying
- Whether Alembic's current detection limitations (e.g., inability to detect indexes) affect your specific schema changes.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.6) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — Flask, Flask-SQLAlchemy, alembic |
| Maintenance | actively maintained — 581 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 5,687,736/month — #2,052 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: Flask_Migrate-4.1.0-py3-none-any.whl
Tags
More Front-Ends packages
SQLAlchemy is a Python SQL toolkit and Object…
permissive · top 100 on PyPI
psycopg2-binarypsycopg2-binary is a PostgreSQL database…
copyleft · top 1,000 on PyPI
alembicAlembic generates and manages database schema…
permissive · top 1,000 on PyPI
weaviate-clientA Python client library for connecting to and…
permissive · top 1,000 on PyPI
databricks-sql-connectorA Python client library that connects to…
permissive · top 1,000 on PyPI
psycopgPsycopg 3 is a PostgreSQL database adapter for…
copyleft · top 1,000 on PyPI
Flask-AlembicFlask-Alembic integrates Alembic database…
permissive · top 15,000 on PyPI
Flask-ScriptFlask-Script provides command-line interface…
permissive · top 15,000 on PyPI
sqlalchemy-migrateProvides database schema migration management…
permissive · top 15,000 on PyPI
Flask-SQLAlchemyFlask-SQLAlchemy integrates SQLAlchemy database…
permissive · top 1,000 on PyPI
atlas-provider-sqlalchemyConnects SQLAlchemy models to Atlas to…
unclear · top 15,000 on PyPI
peewee-migratePeewee Migrate provides a command-line and…
permissive · top 15,000 on PyPI
sqlite-migrateA compatibility shim that re-exports the…
permissive · top 15,000 on PyPI
yoyo-migrationsYoyo-migrations is a database schema migration…
permissive · top 15,000 on PyPI
alembic_utilsExtends Alembic to autogenerate database…
permissive · top 5,000 on PyPI