Laravel 1071 Specified key was too long
出现错误
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
浙公网安备 33010602011771号