mysql can't use unique on a TextField

Bug #524796 reported by Paul Tarjan
48
This bug affects 8 people
Affects Status Importance Assigned to Milestone
django-openid-auth
Confirmed
Undecided
Unassigned

Bug Description

Reported into django : http://code.djangoproject.com/ticket/2495

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

Chris Jones (cmsj)
Changed in django-openid-auth:
status: New → Confirmed
Revision history for this message
Richard Careaga (public-careaga) wrote :

Better temporary fix is to reduce the field length, as follows:

class UserOpenID(models.Model):
    user = models.ForeignKey(User)
    claimed_id = models.TextField(max_length=255, unique=True)
    display_id = models.TextField(max_length=2047)

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.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.