Registry / database / flask-alembic

flask-alembic

JSON →
library3.2.0pypypi✓ verified 35d ago

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.

databaseweb-framework
Install & Compatibility
Where this runs
tested against v3.2.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 1.346s · 50.7MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 4.3s · import 1.252s · 49MB
50MB installed
● package 50MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Old wrapper name before 3.0, now removed

from flask_alembic import Alembic

Initialize Alembic, create first migration, and apply it.

from flask import Flask from flask_sqlalchemy import SQLAlchemy from flask_alembic import Alembic app = Flask(__name__) app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///app.db' db = SQLAlchemy(app) alembic = Alembic(app) with app.app_context(): alembic.init() alembic.revision('Initial migration') alembic.upgrade()
Debug
Known footguns
breakingFlask-Alembic 3.0 dropped support for Python 2 and Python <3.8. Upgrade to Python 3.8+.
breakingThe `FlaskAlembic` class was removed in 3.0. Use `Alembic` instead.
gotchaWhen using multiple databases, you must specify which metadata to associate with each database in the `Alembic` constructor.
gotchaThe Flask application context must be active for most `alembic` CLI commands (e.g., `flask db upgrade`).
deprecatedIn 3.1.0, the `command_name` constructor argument was deprecated. Use the default command name or override via config.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
12 hits · last 30 days
gptbot
4
ahrefsbot
4
claudebot
3
script
1
Resources