【发布时间】:2012-06-23 03:58:04
【问题描述】:
我在 Django 中定义了一个模型,看起来(部分)如下所示:
class Info(models.Model):
information = models.TextField(max_length = 32, null = True, db_index = True)
但是,当我尝试使用 MySql 后端的 syncdb 时,我得到 Failed to install index for app.Info model: (1170, "BLOB/TEXT column 'information' used in key specification without a key length")
我该如何解决这个问题?
【问题讨论】:
-
为什么对 32 个字符的字段使用 BLOB?使用普通的 CharField。
标签: mysql django django-models