1.18.0
Released: January 9, 2026
feature
-
[feature] [operations] When alembic is run in "verbose" mode, alembic now logs a message to
indicate from which file is used to load the configuration.References: #1737
-
[feature] [autogenerate] Autogenerate reflection sweeps now use the "bulk" inspector methods
introduced in SQLAlchemy 2.0, which for selected dialects including
PostgreSQL and Oracle use batched queries to reflect whole collections of
tables using O(1) queries rather than O(N).References: #1771
-
[feature] [autogenerate] Release 1.18.0 introduces a plugin system that allows for automatic
loading of third-party extensions as well as configurable autogenerate
compare functionality on a per-environment basis.The
Pluginclass provides a common interface for extensions that
register handlers among Alembic's existing extension points such as
Operations.register_operation()and
Operations.implementation_for(). A new interface for registering
autogenerate comparison handlers,
Plugin.add_autogenerate_comparator(), provides for autogenerate
compare functionality that may be custom-configured on a per-environment
basis using the new
EnvironmentContext.configure.autogenerate_pluginsparameter.The change does not impact well known Alembic add-ons such as
alembic-utils, which continue to work as before; however, such add-ons
have the option to provide plugin entrypoints going forward.As part of this change, Alembic's autogenerate compare functionality is
reorganized into a series of internal plugins under the
alembic.autogeneratenamespace, which may be individually or
collectively identified for inclusion and/or exclusion within the
EnvironmentContext.configure()call using a new parameter
EnvironmentContext.configure.autogenerate_plugins. This
parameter is also where third party comparison plugins may also be
indicated.See
alembic.plugins.toplevelfor complete documentation on
the newPluginclass as well as autogenerate-specific usage
instructions.
usecase
-
[usecase] [environment] The
file_templateconfiguration option now supports directory paths,
allowing migration files to be organized into subdirectories. When using
directory separators infile_template(e.g.,
%(year)d/%(month).2d/%(day).2d_%(rev)s_%(slug)s), Alembic will
automatically create the necessary directory structure. The
recursive_version_locationssetting must be set totruewhen using
this feature in order for the revision files to be located for subsequent
commands.References: #1774
-
[usecase] Avoid deprecation warning in add/drop constraint added in SQLAlchemy 2.1.
Ensure that alembic is compatible with the changes added in
sqlalchemy/sqlalchemy#13006
by explicitly settingisolate_from_table=Truewhen running with
SQLAlchemy 2.1 or greater.
bug
-
[bug] [postgresql] Fixed issue where PostgreSQL sequence defaults on non-primary key columns
were incorrectly detected as changed on every autogenerate run. Server
default comparison logic is adjusted to filter out the::regclass
expression added by the server which interferes with the comparison.References: #1507
-
[bug] [mssql] Implemented DDL for column comment add/update/delete when using the
Operations.alter_column.commentparameter with
Operations.alter_column()on Microsoft SQL Server. Previously,
these functions were not implemented for SQL Server and would raise
UnsupportedCompilationError.References: #1755