mysql can't use unique on a TextField
Bug #524796 reported by
Paul Tarjan
This bug affects 8 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
django-openid-auth |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
Reported into django : http://
To get around it, you can make the field not have unique=True.
Can you put the unique test into the application instead of the database?
Related branches
lp:~wligtenberg/django-openid-auth/mysql_fix
Ready for review
for merging
into
lp:~django-openid-auth/django-openid-auth/trunk
- django-openid-auth developers: Pending requested
-
Diff: 10 lines (+1/-1)1 file modifieddjango_openid_auth/models.py (+1/-1)
Changed in django-openid-auth: | |
status: | New → Confirmed |
To post a comment you must log in.
Better temporary fix is to reduce the field length, as follows:
class UserOpenID( models. Model): ForeignKey( User) TextField( max_length= 255, unique=True) TextField( max_length= 2047)
user = models.
claimed_id = models.
display_id = models.
Permanent fix might have the max_length argument be set depending on value of django.db.backends; if it's mysql, limit it to 255 (the maximum if the field is to be unique, as it should be); otherwise the default.