1.11.0
1.11.0
Released: May 15, 2023
usecase
-
[usecase] [commands] Added quiet option to the command line, using the
-q/--quiet
option. This flag will prevent alembic from logging anything
to stdout.References: #1109
-
[usecase] [asyncio] Added
AbstractOperations.run_async()
to the operation module to
allow running async functions in theupgrade
ordowngrade
migration
function when running alembic using an async dialect. This function will
receive as first argument an
~sqlalchemy.ext.asyncio.AsyncConnection
sharing the transaction
used in the migration context.References: #1231
bug
-
[bug] [batch] Added placeholder classes for
~.sqla.Computed
and
~.sqla.Identity
when older 1.x SQLAlchemy versions are in use,
namely prior to SQLAlchemy 1.3.11 when the~.sqla.Computed
construct was introduced. Previously these were set to None, however this
could cause issues with certain codepaths that were usingisinstance()
such as one within "batch mode".References: #1237
-
[bug] [batch] Correctly pass previously ignored arguments
insert_before
and
insert_after
inbatch_alter_column
References: #1221
-
[bug] [postgresql] Fix autogenerate issue with PostgreSQL
ExcludeConstraint
that included sqlalchemy functions. The function text was previously
rendered as a plain string without surrounding withtext()
.References: #1230
-
[bug] [mysql] [regression] Fixed regression caused by #1166 released in version 1.10.0 which
caused MySQL unique constraints with multiple columns to not compare
correctly within autogenerate, due to different sorting rules on unique
constraints vs. indexes, which in MySQL are shared constructs.References: #1240
-
[bug] [typing] Updated stub generator script to also add stubs method definitions for the
Operations
class and theBatchOperations
class obtained
fromOperations.batch_alter_table()
. As part of this change, the
class hierarchy ofOperations
andBatchOperations
has
been rearranged on top of a common base classAbstractOperations
in order to type correctly, asBatchOperations
uses different
method signatures for operations thanOperations
.References: #1093
-
[bug] [typing] Repaired the return signatures for
Operations
that mostly
returnNone
, and were erroneously referring toOptional[Table]
in many cases. -
[bug] [autogenerate] Modified the autogenerate implementation for comparing "server default"
values from user-defined metadata to not apply any quoting to the value
before comparing it to the server-reported default, except for within
dialect-specific routines as needed. This change will affect the format of
the server default as passed to the
EnvironmentContext.configure.compare_server_default
hook, as
well as for third party dialects that implement a custom
compare_server_default
hook in their alembic impl, to be passed "as is"
and not including additional quoting. Custom implementations which rely
on this quoting should adjust their approach based on observed formatting.References: #1178
-
[bug] [api] [autogenerate] Fixed issue where
autogenerate.render_python_code()
function did not
provide a default value for theuser_module_prefix
variable, leading to
NoneType
errors when autogenerate structures included user-defined
types. Added new parameter
autogenerate.render_python_code.user_module_prefix
to allow
this to be set as well as to default toNone
. Pull request courtesy
tangkikodo.References: #1235
misc
-
[change] [py3k] Argument signatures of Alembic operations now enforce keyword-only
arguments as passed as keyword and not positionally, such as
Operations.create_table.schema
,
Operations.add_column.type_
, etc.References: #1130
-
[misc] Update code snippets within docstrings to use
black
code formatting.
Pull request courtesy of James Addison.References: #1220