I am trying to learn a bit of django and trying to insert some values in a database (using model forms), but this seems failing citing:
django.db.utils.OperationalError: index row size 3008 exceeds maximum 2712 for index "appname_mymodel_ggg_like"
My models are quite simple and look like so:
class myModel(TimeStampedModel):
fff = models.URLField(db_index=False, blank=False,primary_key=False)
ggg = models.TextField(db_index=False, blank=False,primary_key=False)
mj = models.BooleanField(db_index=False, blank=False, primary_key=False, default=False) # req field
def __unicode__(self):
return self.fff
Does this mean that the string is long (yes it is, but not a 1MB string or anything)? This is the reason I was using text field.. but this does not seem to help.
Any hints would be appreciated..
If anyone gets here through the error message, for me it was this unresolved bug.
Basically a django TextField can be large in size, but if we make it unique as well, the uniqueness check can break.
A suggested "fix" was using the md5 hash for the uniqueness check.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With