Replies: 1 comment
-
Hi, This is something where a type checker may be best suited for it. You will get an error there since the second arg of |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've just tracked down a bug where we were trying to alter the server_default of a column, and it wasn't applying.
The first version of the script attempted to mirror the "add_column" syntax, so for add_column we have:
The (incorrect) syntax we were using for alter column was
when in fact the correct syntax is
Because
str(sqlalchemy.Column("column_name", ...)) == "column_name"
, alembic just sees this as analter_column
statement with no changes.I'm wondering if some kind of error - or at least warning - here could have saved me some blushes.
Possibly a warning if the 2nd argument to alter_column is of type sa.Column? And/or if there's an alter_column statement that doesn't make any changes?
It felt like this isn't really a bug, but it's definitely a developer quality of life issue
Beta Was this translation helpful? Give feedback.
All reactions