sqlalchemy / alembic

A database migrations tool for SQLAlchemy.
MIT License
2.81k stars 243 forks source link

Alembic detecs type change from TINYINT(display_width=1) to Boolean() in MySQL, although it's the same thing #374

Closed sqlalchemy-bot closed 8 years ago

sqlalchemy-bot commented 8 years ago

Migrated issue, originally created by Leonid Umanskiy

Hi, I am using flask-migrate which is based on Alembic. When I turn on the compare_type=True, alembic starts to detect "changes" in the table, from TINYINT(display_width=1) to Boolean(). Because of this, flask-migrate always detects changes in boolean columns.

Here is an example code:

class Item(db.Model):
    item_id = db.Column(INTEGER(unsigned=True), primary_key=True)
    unique = db.Column(db.Boolean(), nullable=False, default=False)
sqlalchemy-bot commented 8 years ago

Michael Bayer (@zzzeek) wrote:

Duplicate of #46.

sqlalchemy-bot commented 8 years ago

Michael Bayer (@zzzeek) wrote:

please see the workaround in #46 and/or supply a type comparison function that works the way you want as documented at http://alembic.readthedocs.io/en/latest/autogenerate.html#comparing-types.

sqlalchemy-bot commented 8 years ago

Changes by Michael Bayer (@zzzeek):