1.19.2
Released: September 4, 2026
changed
-
[changed] [autogenerate] The autogenerate plugin for CHECK constraint detection by name, added in
1.19.0. for #508, is no longer enabled by default. It has been
renamed fromalembic.autogenerate.checkconstraint_bynameto
alembic.ext.checkconstraint_bynameand no longer matches on the
"alembic.autogenerate.*"wildcard, which remains the default plugin
specification. The previous name will still function as well if placed in
the plugins list explicitly, both to enable the plugin and within a
"~"exclusion, so that anenv.pywritten against 1.19.0 or 1.19.1
requires no change.The plugin is now recommended only for schemas that ensure the naming of
all constraints using a client side naming convention, otherwise there's a
persistent risk of false positives. See
autogenerate_check_constraintsfor background on things to be aware
of when using this plugin.As part of this change "type bound" CHECK constraints, which include
constraints generated for theBooleanandEnumdatatypes when the
create_constraintparameter is set to True, are no longer ignored in
the metadata side, so that normal name-based matching can occur for
these constraints.References: #1859
usecase
-
[usecase] [autogenerate] [batch] The target of a
~sqlalchemy.schema.ForeignKeyis now located
using theForeignKey.target_tokensand
ForeignKey.target_table_keyaccessors added in SQLAlchemy 2.1, rather
than by splitting the dotted string form of that target on".". As a
dot inside a schema, table or column name cannot be told apart from the
separator between those names, a foreign key whose target name contained
a dot was previously mis-parsed by autogenerate rendering as well as by
batch migrations. The dotted string continues to be split when running
against SQLAlchemy 2.0, where these accessors are not present. Thanks to
Gyanu Mayank for the initial pull request.References: #1860