Alembic is a database migration tool for SQLAlchemy. It helps developers manage schema changes over time, applying and tracking migrations for their database.
Project status
- Actively maintained: Alembic has multiple recent tagged updates in 1.18.x throughout January–February 2026 (including feature/plugin work in 1.18.0 and follow-on fixes), indicating ongoing active development rather than maintenance-only mode.
- Update cadence: In ~one month, it shipped 1.18.0 (Jan 9) → 1.18.1 (Jan 14) → 1.18.2 (Jan 28) → 1.18.3 (Jan 29) → 1.18.4 (Feb 10), with several very small follow-up updates—suggesting a fast-moving stabilization cycle after a larger change set.
AI summary generated 3 weeks ago
Recent updates
rel_1_18_4
3 months agoThis patch reverts the automatic inlining of PRIMARY KEY in Operations.add_column (changed in 1.18.2) and introduces an opt-in parameter inline_primary_key to restore that behavior. The change fixes incorrect rendering for PostgreSQL SERIAL primary keys and gives explicit control over SQL generation; users who relied on the 1.18.2 behavior must opt in after upgrading.
BreakingFeaturesrel_1_18_3
4 months agoRelease 1.18.3 fixes a regression in autogenerate that caused NoReferencedTableError when foreign key constraints pointed to tables not present in the initial reflection; the fix creates placeholder Table objects so autogenerate can proceed while keeping a prior performance optimization. The release also raises the minimum supported SQLAlchemy 1.4 version to 1.4.23 to address a regression related to generic type subscripting.
Breakingrel_1_18_2
4 months agoAlembic 1.18.2 focuses on `add_column()` DDL generation: `Column(primary_key=True)` is now rendered inline as `PRIMARY KEY`, and the new `inline_references` flag can inline single-column foreign keys as `REFERENCES` clauses. The release also broadens `server_default` typing for alter-column operations so common SQLAlchemy expressions like `null()` and `text()` are accepted.
Featuresrel_1_18_1
4 months agoAlembic 1.18.1 is a small bugfix release centered on the new plugin logger naming fix and a revision to SQLAlchemy 2.1 constraint handling around `isolate_from_table`. It also bumps the package and documentation version metadata to 1.18.1.
rel_1_18_0
4 months agoAlembic 1.18.0 adds a new plugin system, expands autogenerate behavior, and improves reflection performance for supported dialects. The code diff shows a major internal autogenerate rewrite: comparator logic was split into plugin-backed modules and dispatch now uses priority-based results instead of the older flat dispatcher model.
Featuresrel_1_17_2
6 months agoAlembic 1.17.2 adds a new extensibility hook that lets applications replace existing operation implementations with `Operations.implementation_for(..., replace=True)`, including built-in operations like `CreateTableOp`. It also fixes the SQL Server `ALTER COLUMN` flow so existing default constraints are dropped before type/default changes, avoiding the issue described in #1744.
Featuresrel_1_17_1
7 months agoThis release adds a new `--check-heads`/`check_heads` mode for `alembic current` that raises `DatabaseNotAtHead` when the database is not at all head revisions, and it exposes that exception in the public API/docs. It also tightens revision ID validation so custom revision identifiers can no longer contain `:`.
BreakingFeaturesrel_1_17_0
7 months agoThis release mainly modernizes Alembic's contributor tooling, moving the default test workflow from tox to nox and adding a new noxfile.py, while keeping tox temporarily available. It also raises the supported runtime floor to Python 3.10 and updates packaging/CI metadata accordingly. The diff includes additional compatibility and autogenerate behavior changes that are not called out in the release notes.
BreakingFeaturesrel_1_16_5
9 months agoAlembic 1.16.5 is a small bugfix release focused on MySQL autogenerate index-expression rendering and pyproject.toml config parsing. Most changes are internal, with the main user-visible effects being corrected MySQL index DDL generation and support for integer TOML config values.
rel_1_16_4
10 months agoAlembic 1.16.4 is a narrow bugfix release centered on restoring correct `pyproject.toml` handling for boolean configuration values. The code updates config parsing and `ScriptDirectory` initialization so `recursive_version_locations` and `sourceless` now read TOML booleans properly, with regression tests added.
rel_1_16_3
10 months agoThis release adds a new `pyproject_async` init template for async DBAPI projects and a new `module` post-write hook runner for invoking tools via `python -m`. It also fixes autogenerate rendering for `FetchedValue()` server defaults and for foreign keys inside `CreateTableOp` objects that lack a metadata context.
Featuresrel_1_16_2
11 months agoAlembic 1.16.2 is a small bug-fix release centered on autogenerate rendering and command/template generation. It now correctly propagates dialect-specific foreign key kwargs into generated `create_foreign_key()` calls and inserts the expected blank line when appending to an existing `pyproject.toml`.
rel_1_16_1
5/21/2025This is a small 1.16.1 bugfix release focused on restoring template lookup behavior after the pathlib refactor and correcting the missing-template error message. The code changes are narrowly scoped to `Config`/`command.init`, plus release metadata and new regression tests.
rel_1_16_0
5/21/2025Alembic 1.16.0 is a configuration- and autogenerate-focused release: it adds first-class pyproject.toml/PEP 621 support, a custom CLI command registration API, and IF [NOT] EXISTS helpers for several DDL operations. It also modernizes path handling with pathlib, fixes autogenerate naming/prefix issues, and removes a few build/runtime warnings.
Featuresrel_1_15_2
3/28/2025This release is a focused bug fix for Alembic autogenerate behavior. It corrects rendering of op directives so `AlterColumnOp.modified_name` is respected in rewriter-based workflows, which helps custom autogenerate recipes produce the expected output.