Monday, January 8, 2018

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

The issue was solved by the following way -  Add the following code in  AppServiceProvider.php under App/Providers folder  and don't... thumbnail 1 summary
The issue was solved by the following way - 
Add the following code in AppServiceProvider.php under App/Providers folder  and don't forget to import schema class
Laravel5_root/app/Providers/AppServiceProvider.php

The code block

use Illuminate\Support\Facades\Schema; 

function boot()
{
    Schema::defaultStringLength(191); //Solved by increasing StringLength
}

No comments

Post a Comment