django.db.utils.OperationalError: (1071, 'Specified key was too long; max key length is 1000 bytes')

0x01

说明:

python manage.py makemigrations -- 正常

python manage.py migrate -- 报错

0x02

 > 调试发现, model文件的 max_length 有1024的字段
        修改为 1000 --> 还是报错  
        修改为 255 --> 还是报错
        修改为 200 ---> 正常了

原文链接: django.db.utils.OperationalError: (1071, 'Specified key was too long; max key length is 1000 bytes') 版权所有,转载时请注明出处,违者必究。
注明出处格式:流沙团 ( https://gyarmy.com/post-658.html )

发表评论

0则评论给“django.db.utils.OperationalError: (1071, 'Specified key was too long; max key length is 1000 bytes')”