Laravel 5.4 migrate时报错: Specified key was too long error
Posted tangqi9602
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Laravel 5.4 migrate时报错: Specified key was too long error相关的知识,希望对你有一定的参考价值。
手动配置迁移命令migrate
生成的默认字符串长度,在AppServiceProvider
中调用Schema::defaultStringLength
方法来实现配置:
use Illuminate\Support\Facades\Schema;
public function boot()
{
Schema::defaultStringLength(191);
}
以上是关于Laravel 5.4 migrate时报错: Specified key was too long error的主要内容,如果未能解决你的问题,请参考以下文章
Laravel 5 migrate时报错: Specified key was too long error
laravel migrate时报错:Syntax error or access violation: 1071 Specified key was too long; max key length