Back to Explore

sqlalchemy/alembic

GitHub
2 watchersOpen source

Last release: 2026-02-10

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: The upstream repo shows a very recent push on 2026-05-31, and Alembic has been shipping frequent updates in early 2026 (e.g., 1.18.0 to 1.18.4 during Jan to Feb 2026).
  • Update cadence: Based on the tagged recent updates shown, there was rapid iteration from 2026-01-09 (1.18.0) through 2026-02-10 (1.18.4), indicating an active development period close to the present date.

AI summary generated 2026-06-09

AI-generated from public sources. May be inaccurate. Report

Recent updates

  • rel_1_18_4

    2026-02-10

    This 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.

    BreakingFeatures
  • rel_1_18_3

    2026-01-29

    Release 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.

    Breaking
  • rel_1_18_2

    2026-01-28

    Alembic 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.

    Features
  • rel_1_18_1

    2026-01-14

    Alembic 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

    2026-01-09

    Alembic 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.

    Features
  • rel_1_17_2

    2025-11-14

    Alembic 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.

    Features
  • rel_1_17_1

    2025-10-29

    This 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 `:`.

    BreakingFeatures
  • rel_1_17_0

    2025-10-11

    This 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.

    BreakingFeatures
  • rel_1_16_5

    2025-08-27

    Alembic 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

    2025-07-10

    Alembic 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

    2025-07-08

    This 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.

    Features
  • rel_1_16_2

    2025-06-16

    Alembic 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

    2025-05-21

    This 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

    2025-05-21

    Alembic 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.

    Features
  • rel_1_15_2

    2025-03-28

    This 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.