alembic: Doesn't import custom column types like ArrowType from the right place

Migrated issue, originally created by nickretallack (@nickretallack)

I wrote a simple model in Flask-SQLAlchemy like this:

from sqlalchemy_utils.types.arrow import ArrowType
class MyModel(db.Model):
    created_at = db.Column(ArrowType)

Then I generated the migration using Flask-Migrate, which uses Alembic internally, and it generated this:

...
import sqlalchemy as sa
...
    sa.Column('created_at', sa.ArrowType(), nullable=True),
...

Of course, ArrowType is not part of sqlalchemy, so I edited it to import it from the right place. It’d be cool if it got the import correct

About this issue

  • Original URL
  • State: closed
  • Created 10 years ago
  • Comments: 15

Most upvoted comments

Michael Bayer (@zzzeek) wrote:

also, I’m an older person, sorry if this is normal for younger folks these days but calling my code “pretty shitty” is not a great way to inspire me to care about changing it for you.