Alembic: Does not detect change in field length

Created on 24 Oct 2019  路  2Comments  路  Source: sqlalchemy/alembic

Changes are not detected when I try to change the length of a field
I am using with PostgreSQL
For example:

field = db.Column(db.String(50)) to field = db.Column(db.String(100))

NFO [alembic.env] No changes in schema detected.

question

All 2 comments

hi there-

have you set compare_type to True? also what backend are you using.

it's not without irony that literally three hours later issue #613 was posted by someone else entirely stating that they want to document that this length comparison does actually occur, even though it is documented as not occurring.

TLDR;

  1. set compare_type=True https://alembic.sqlalchemy.org/en/latest/autogenerate.html#compare-types

  2. the docs say that string lengths aren't compared, but this is a bug in the docs :)

hi there-

have you set compare_type to True? also what backend are you using.

it's not without irony that literally three hours later issue #613 was posted by someone else entirely stating that they want to document that this length comparison does actually occur, even though it is documented as not occurring.

TLDR;

  1. set compare_type=True https://alembic.sqlalchemy.org/en/latest/autogenerate.html#compare-types
  2. the docs say that string lengths aren't compared, but this is a bug in the docs :)

Edit the question

it works with compare_type

Was this page helpful?
0 / 5 - 0 ratings