Got a problem when sqlalchemy 0.8.0b1 works with alembic 0.3.6

156 views
Skip to first unread message

junepeach

unread,
Jan 3, 2013, 9:58:34 AM1/3/13
to sqlal...@googlegroups.com
When I updated sqlalchemy from version 0.7.9 to current one, my mediumtext text type works in Sqlite and Mysql, but doesn't work for Postgresql DB server anymore. I defined:
mediumtextsize = 2**24 - 1 in my data module. When I run: alembic upgrade head, I got

sqlalchemy.exc.ProgrammingError: (ProgrammingError) type modifier is not allowed for type "text"
LINE 6: status TEXT(16777215),

Not sure what is going on there, does anybody else here has some issue?

Thanks and Happy New Year!

LYH

Michael Bayer

unread,
Jan 3, 2013, 12:49:01 PM1/3/13
to sqlal...@googlegroups.com
PG doesn't allow a length for the TEXT type.

you might want to go with this approach:

mytype = Text().with_variant(MEDIUMTEXT(), 'mysql')

http://docs.sqlalchemy.org/en/rel_0_8/core/types.html?highlight=with_variant#sqlalchemy.types.TypeEngine.with_variant
> --
> You received this message because you are subscribed to the Google Groups "sqlalchemy" group.
> To view this discussion on the web visit https://groups.google.com/d/msg/sqlalchemy/-/xfPxnx2TCT4J.
> To post to this group, send email to sqlal...@googlegroups.com.
> To unsubscribe from this group, send email to sqlalchemy+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
>

junepeach

unread,
Jan 3, 2013, 3:05:34 PM1/3/13
to sqlal...@googlegroups.com
Thank you! I will try :)
Reply all
Reply to author
Forward
0 new messages