String length change not being detected by Alembic (even with compare_type=True) #1256
-
Version:
Am having issues with alembic not detecting String length changes even with Changing this:
to:
Does not bring about any changes when running
The env.py sections:
Based on this thread, the change should detect string length changes. (#612) Please let me know if I'm missing anything. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
it's likely this is expected because going from unlengthed to lengthed might have some guards against false positives going on. that said, if you can please share:
|
Beta Was this translation helpful? Give feedback.
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.