rosarior/mayan — Issue #12: Problem with mysql indexes
Author: timini
Created: 2011-10-21 21:42:57+00:00
State: open

running syncdb gives me these errors:

```shell
Failed to install index for documents.Document model: (1170, "BLOB/TEXT column 'description' used in key specification without a key length")
Failed to install index for documents.DocumentPage model: (1170, "BLOB/TEXT column 'content' used in key specification without a key length")
No fixtures found.
```
```python
description = models.TextField(blank=True, null=True, verbose_name=_(u'description'), db_index=True)
```
[Indexes for varchar and text columns](https://docs.djangoproject.com/en/dev/ref/databases/#indexes-for-varchar-and-text-columns)
When specifying db_index=True on your model fields, Django typically outputs a single CREATE INDEX statement. However, if the database type for the field is either varchar or text (e.g., used by CharField, FileField, and TextField), then Django will create an additional index that uses an appropriate PostgreSQL operator class for the column. The extra index is necessary to correctly perfrom lookups that use the LIKE operator in their SQL, as is done with the contains and startswith lookup types.