Change8

Alembic

Backend & Infra

A database migrations tool for SQLAlchemy.

Latest: rel_1_18_418 releases5 breaking changes3 common errorsView on GitHub

Release History

rel_1_18_4Breaking1 fix
Feb 10, 2026

This patch reverts the automatic inline rendering of PRIMARY KEY constraints in `Operations.add_column()` introduced in 1.18.2, making this behavior explicitly opt-in via the new `inline_primary_key` parameter.

rel_1_18_32 fixes
Jan 29, 2026

This patch fixes a critical regression in autogenerate related to foreign key referencing unreflected tables and updates the minimum required SQLAlchemy version for the 1.4 series to 1.4.23.

rel_1_18_21 fix2 features
Jan 28, 2026

This release enhances `Operations.add_column()` by honoring the `primary_key` parameter and introducing the `inline_references` option for foreign key rendering. A typing bug affecting server default parameters in `AlterColumnOp` was also resolved.

rel_1_18_12 fixes
Jan 14, 2026

This patch release addresses a logging issue in the new plugin system and revises handling of SQLAlchemy 2.1 deprecation warnings related to isolate_from_table=True.

rel_1_18_0
Jan 9, 2026
rel_1_17_21 fix1 feature
Nov 14, 2025

Version 1.17.2 introduces a replace parameter for operation implementations and fixes a SQL Server dialect bug related to default constraint handling.

rel_1_17_1Breaking1 fix1 feature
Oct 29, 2025

Version 1.17.1 introduces a new `--check-heads` option for `alembic current` and tightens revision ID validation by rejecting ':' characters, requiring migration of any existing colon‑containing IDs.

rel_1_17_0Breaking
Oct 11, 2025

Version 1.17.0 raises the minimum Python requirement to 3.10 and switches the internal test runner to nox, with tox support slated for removal.

rel_1_16_52 fixes
Aug 27, 2025

Release 1.16.5 resolves two bugs: correct MySQL index expression rendering and proper parsing of `truncate_slug_length` in pyproject.toml configuration.

rel_1_16_41 fix
Jul 10, 2025

This release resolves a bug in pyproject.toml handling that prevented boolean values for certain configuration options from being recognized.

rel_1_16_32 fixes2 features
Jul 8, 2025

Release 1.16.3 introduces the `pyproject_async` template and a new module post‑write hook for autogenerate, and fixes rendering issues with server defaults and foreign key constraints.

rel_1_16_22 fixes
Jun 16, 2025

Version 1.16.2 addresses two bugs: it restores proper rendering of dialect-specific keyword arguments for foreign key operations and corrects newline handling when updating `pyproject.toml`.

rel_1_16_12 fixes
May 21, 2025

Version 1.16.1 addresses two regressions introduced by a pathlib refactor, restoring proper template directory handling and fixing missing template error messages.

rel_1_16_0Breaking4 fixes6 features
May 21, 2025

Alembic 1.16.0 adds PEP 621 configuration, a new CLI registration API, enhanced path handling, and several operation flags, while fixing autogenerate and deprecation issues.

rel_1_15_21 fix
Mar 28, 2025

Bug fix for autogenerate handling of AlterColumnOp.modified_name.

rel_1_15_11 fix
Mar 4, 2025

Release 1.15.1 resolves an installation bug where Alembic's template files were omitted from the wheel distribution due to a PEP 621 pyproject.toml issue.

rel_1_15_0Breaking2 fixes2 features
Mar 4, 2025

Alembic 1.15.0 drops support for Python 3.8 and SQLAlchemy 1.3, adds label rendering for index autogeneration and revision context to diff detection, and includes several lint‑friendly and rendering bug fixes.

rel_1_14_12 fixes1 feature
Jan 19, 2025

Version 1.14.1 introduces SQLite column rename support, adds tzdata to tz extras, and resolves autogenerate Variant type rendering bugs.

Common Errors

UnsupportedCompilationError1 report

UnsupportedCompilationError in Alembic often arises when the database dialect lacks support for a specific DDL operation used in your migration (like altering column comments in MSSQL). Address this by either using a different, supported approach (e.g., custom SQL execution with `op.execute()`) or, if possible, updating to a newer Alembic version that provides better dialect support for the specific operation. Review the database's documentation and alembic's dialect implementation before choosing an alternative.

NotImplementedError1 report

The "NotImplementedError" in Alembic often arises when a specific database operation, like `drop_constraint` with `if_exists`, isn't fully supported by the underlying database or SQLAlchemy version you are using. To fix it, conditionally execute the operation only when supported, typically by checking the database dialect or SQLAlchemy version, and provide an alternative implementation (or skip the operation) when not supported. Alternatively, upgrade SQLAlchemy to a version where the feature is implemented, ensuring compatibility with your database.

NameError1 report

This NameError in Alembic usually arises when a required class or function, such as `FetchedValue`, is used without being properly imported from the SQLAlchemy or Alembic libraries. To resolve this, add an explicit import statement at the top of your migration script, such as `from sqlalchemy.orm import FetchedValue` or `from sqlalchemy import FetchedValue`, depending on the specific location of the missing class in the SQLAlchemy/Alembic library. Ensure the import statement aligns with the documentation for the Alembic/SQLAlchemy version being used.

Related Backend & Infra Packages

Subscribe to Updates

Get notified when new versions are released

RSS Feed