1.18.4
Released: February 10, 2026
bug
-
[bug] [operations] Reverted the behavior of
Operations.add_column()that would
automatically render the "PRIMARY KEY" keyword inline when a
Columnwithprimary_key=Trueis added. The automatic
behavior, added in version 1.18.2, is now opt-in via the new
Operations.add_column.inline_primary_keyparameter. This
change restores the ability to render a PostgreSQL SERIAL column, which is
required to beprimary_key=True, while not impacting the ability to
render a separate primary key constraint. This also provides consistency
with theOperations.add_column.inline_referencesparameter and
gives users explicit control over SQL generation.To render PRIMARY KEY inline, use the
Operations.add_column.inline_primary_keyparameter set to
True:op.add_column(
"my_table",
Column("id", Integer, primary_key=True),
inline_primary_key=True
)References: #1232