tortoise / aerich

A database migrations tool for TortoiseORM, ready to production.
https://github.com/tortoise/aerich
Apache License 2.0
804 stars 90 forks source link

Problem with long enums #276

Open l1f opened 1 year ago

l1f commented 1 year ago

I noticed that aerich handles enums strangely. Instead of creating them as ENUM field in the table, a VARCHAR(length of the longest field in the enum) is used and the intended values are stored as a commetar at the field.

However, this currently leads to problems for me, I have relatively many entries in an enum, which is why I get an error when I try to execute the migration.

pymysql.err.OperationalError: (1629, "Comment for field 'type' is too long (max = 1024)")

My workaround is to remove the comment field from the migration. However, this is a bit annoying in the long run, because aerich tries to add the comment every time I create a new migration.

Is there any plan to support enum fields in the database as well?