c# asp.net core Identity EntityFrameworkCore efcore Mysql索引字段太长解决方案

Index column size too large. The maximum column size is 767 bytes.
Specified key was too long; max key length is 767 bytes

针对以上2个错误的解决方式

暴力解决

替换掉  Add-Migration 后生成的迁移文件  所有的255   256
替换为100 即可
精细点就把所有的索引键的
varchar(255)  和varchar(256)
修改为varchar(100)
然后update-database即可
posted @ 2020-10-15 20:37  ToLing·  阅读(278)  评论(0编辑  收藏  举报