Repository navigation
1.20.1
Released: October 21, 2026
bug
-
[bug] [autogenerate] Fixed issue where a table or column comment set to an empty string would
cause autogenerate to detect a comment change on every run. As most
backends, including PostgreSQL, MySQL, MariaDB and Oracle, don't store an
empty string comment distinctly from no comment, autogenerate now treats
an empty string comment the same asNonewhen comparing comments.
Additionally, an empty string comment is now rendered in
op.create_table()andop.add_column()directives, where it was
previously omitted. Pull request courtesy vineoy.References: #1085
-
[bug] [autogenerate] [postgresql] Fixed rendering of the PostgreSQL
~sqlalchemy.dialects.postgresql.DOMAINtype in autogenerated
migration scripts. Previously the type was rendered usingrepr(),
which omitted thecheck,not_null,default,collation,
constraint_name,schemaandcreate_typearguments and did not
apply a dialect prefix to the underlying data type. The full set of
arguments is now rendered and the underlying data type is rendered using
the standard type-rendering logic. Pull request courtesy Sebastian Cao.References: #1360
-
[bug] [autogenerate] [postgresql] Fixed false-positive "Computed default cannot be modified" warning emitted
during autogenerate when comparing PostgreSQLComputedcolumns
whose reflected SQL expression includes type cast specifiers such as
::regconfigor::text, which PostgreSQL adds to the expression as
stored. These cast specifiers are now stripped before comparison so that
otherwise equivalent expressions no longer trigger the warning. Pull
request courtesy Sebastian Cao.References: #1462
-
[bug] [autogenerate] [postgresql] Fixed issue where autogenerate would detect an unchanged PostgreSQL
expression-based index as modified when the expression included type
casts, such as a cast to a type with a length or precision, a nested
cast, or a cast followed by aDESCmodifier. -
[bug] [postgresql] Fixed bug where
Operations.alter_column()against a PostgreSQL
identity column would render an incomplete, invalidALTER TABLE ... ALTER COLUMNstatement with no clause at all whenexisting_server_default
was omitted, even if there were no existing server default. Pull request
courtesy Riti Grover.References: #1504
-
[bug] [environment] Fixed issue where a third party plugin published using the
alembic.pluginsentrypoint, configured to refer to a plugin module as
documented atalembic.plugins.toplevel, would causeimport alembicto fail with aTypeError, as the loaded module was
erroneously iterated rather than being set up directly. An entrypoint
that refers to a collection of modules, the form which inadvertently
worked previously, continues to be accepted but now emits a deprecation
warning.References: #1873
-
[bug] [autogenerate] Fixed issue where dialect-specific keyword arguments on a
ForeignKeyConstraint,ForeignKeyor
CheckConstraint, such aspostgresql_not_valid, were not
rendered for the constraints that are part of an autogenerated
Operations.create_table()directive, nor for an autogenerated
Operations.create_check_constraint()directive. The
Operations.create_table()case additionally requires SQLAlchemy
2.0.55 / 2.1.5 or greater, which include the fix for SQLAlchemy issue
#13677 where these arguments were lost when theTablewas
copied.References: #1876
-
[bug] [autogenerate] Fixed issue where, when using SQLAlchemy 2.1, the CHECK constraint
generated by a type such as~sqlalchemy.types.Enumor
~sqlalchemy.types.Booleanwithcreate_constraint=Truewould
be rendered by autogenerate as explicitsa.CheckConstraint()entries
withinop.create_table(), in addition to the type itself which
already produces that constraint, leading to a duplicate constraint error
when the migration is run.References: #1884
-
[bug] [operations] Fixed issue where a
CreateTableOpproduced from an existing
~sqlalchemy.schema.TableusingCreateTableOp.from_table()
would emit the CHECK constraint generated by a type such as
~sqlalchemy.types.Enumor~sqlalchemy.types.Boolean
withcreate_constraint=Truetwice in the resulting CREATE TABLE
statement when invoked directly.