Laravel 1071 Specified key was too long
出现错误
SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes (SQL: alter
table `users` add unique `users_email_unique`(`email`))
解决方法:参考了
可以在 AppServiceProvider.php 文件(此文件在app/Providers/下)里的 boot 方法里设置一个默认值:
use Illuminate\Support\Facades\Schema;
public function boot() { // Schema::defaultStringLength(191); }
参考:https://blog.csdn.net/sinat_33801009/article/details/80817486

更多精彩