Back to Explore

sqlalchemy/alembic

GitHub
3 updates · last 90 days2 watchersOpen source

Last release:

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: GitHub shows an upstream push on 2026-08-12, and the 1.19.x and 1.18.x series includes multiple recent updates in 2026.
  • Update cadence: From 2026-01 onward there are frequent patches (several in Jan-Feb 2026), then a gap until 2026-06-25, followed by quicker follow-ups (1.19.0 on 2026-08-04, 1.19.1 on 2026-08-08, plus another push on 2026-08-12).

AI summary generated

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

Recent updates

  • rel_1_19_1

    Release 1.19.1 primarily fixes Alembic autogenerate detection for check constraints, specifically addressing cases where check constraints bound to columns were not correctly considered. The code changes also include CI workflow updates (Python 3.15) and related test infrastructure adjustments to cover column-bound check constraints.

  • rel_1_19_0

    Alembic 1.19.0 adds autogeneration support for named CHECK constraints via a new autogenerate plugin, plus a fix for offline SQL mode where `stamp` and `downgrade` to `base` incorrectly emitted `DROP TABLE alembic_version`. It also updates CI and packaging metadata for newer Python versions and modernizes many type annotations to use PEP 604 style unions.

    Features
  • rel_1_18_5

    Release 1.18.5 adds new usability options to Alembic commands and ScriptDirectory head resolution, and includes several autogenerate and DDL rendering bug fixes. The most notable user-facing additions are merge() support for a new splice option and ScriptDirectory.get_heads() gaining consider_depends_on behavior to match effective heads after upgrades.

    Features
  • rel_1_18_4

    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

    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

    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

    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

    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

    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

    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

    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

    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

    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

    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

    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

    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

    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

    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.