pennersr/django-allauth — pull request #250 by rabialam (2013-04-11 21:43:45+00:00)
Title: (#249) model change and migration for SocialToken to use TextField

(from my issue https://github.com/pennersr/django-allauth/issues/249):

The token ought to be a TextField because there's not really anyway to establish for every oauth provider what the maximum length of the token is. This is illustrated in this stackoverflow thread:
http://stackoverflow.com/questions/4408945/what-is-the-length-of-the-access-token-in-facebook-oauth2

As it details, some providers like Yahoo can issue tokens up to 400 characters in length, and some are already getting even larger tokens than 255 characters from Facebook. With modern databases, there's no performance real loss associated with using a TextField:

http://stackoverflow.com/questions/4848964/postgresql-difference-between-text-and-varchar-character-varying

Consequently, I think making the SocialToken model use a TextField to store the token is a much needed solution. Without it, we'll just be gradually elongating the token field as things break when we could just save the unnecessary migrations by appropriately using a variable length text field for a variable length piece of data (even if we wish it wasn't so variably sized) once and for all.