0
点赞
收藏
分享

微信扫一扫

SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length


AppServiceProvider boot方法下新增


Schema::defaultStringLength(191);

<?php

namespace App\Providers;

use Illuminate\Support\Facades\Schema;
use Illuminate\Support\ServiceProvider;

class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*
* @return void
*/
public function register()
{
//
}

/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
Schema::defaultStringLength(191);
}
}

举报

相关推荐

0 条评论