I had this in my models.py
category = models.CharField(max_length=1024, null=False)
I changed it to this:
category = models.CharField(max_length=256, null=False)
and migrated successfully.
and then I changed it to this:
category = models.CharField(max_length=256, null=False, db_index=True)
While migrating I get this:
_mysql_exceptions.Warning: Specified key was too long; max key length is 767 bytes
and migration breaks.
ただし、phpmyadmin パネルを開くと、インデックスが作成されていることがわかります。
気にする必要がありますか?この警告が表示されないようにする必要がありますか? この警告は重要ですか?
編集:フィールド照合はutf8_general_ci