Skip to content

String length change not being detected by Alembic (even with compare_type=True) #1256

Discussion options

You must be logged in to vote

PG allows for unlengthed VARCHAR. the alembic type comparison rules are set so that they only report a "positive" if two parameters don't match. if the number of parameters are different, it does not attempt to guess, so in this case VARCHAR and VARCHAR(6) have a different number of parameters; it's a negative. the overarching priority is to not produce false positives, since a false negative means editing a single migration file to fix for the miss, but a false positive means editing every migration file.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@blamcodes
Comment options

@zzzeek
Comment options

Answer selected by blamcodes
@blamcodes
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants