Skip to content

Is AlterColumnOp.modify_name ignored? #1632

Answered by zzzeek
lenvk asked this question in Usage Questions
Mar 26, 2025 · 1 comments · 13 replies
Discussion options

You must be logged in to vote

hi -

I think this is a bug that has always been there, because you're looking at the output of render.py -> _alter_column(), and if you look in that function, it isn't even looking at modify_name at all, nor is it looking in that older version etiher.

if you want to open an issue and PR here's a patch

diff --git a/alembic/autogenerate/render.py b/alembic/autogenerate/render.py
index 50c51fa..ffc277d 100644
--- a/alembic/autogenerate/render.py
+++ b/alembic/autogenerate/render.py
@@ -505,6 +505,7 @@ def _alter_column(
     type_ = op.modify_type
     nullable = op.modify_nullable
     comment = op.modify_comment
+    newname = op.modify_name
     autoincrement = op.kw.get("autoincrement", …

Replies: 1 comment 13 replies

Comment options

You must be logged in to vote
13 replies
@zzzeek
Comment options

@zzzeek
Comment options

@lenvk
Comment options

@zzzeek
Comment options

@lenvk
Comment options

Answer selected by lenvk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants