LaravelDaily / Laravel-Vue-First-CRUD

Simple demo project for Laravel 5.5 and Vue.js with one CRUD operation.
257 stars 156 forks source link

The old SQL error for index key too long #1

Closed webstractions closed 6 years ago

webstractions commented 6 years ago

A common problem when running migrations is the SQL error for long indexes.

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

This requires editing App\Providers\AppServiceProvider::boot() method to up the string length.

<?php
namespace App\Providers;

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

class AppServiceProvider extends ServiceProvider
{
    public function boot()
    {
        Schema::defaultStringLength(191);
    }
    ...
}
pradeep3 commented 6 years ago

@webstractions we cant say it is an issue with this application. This is a common issue in laravel when you use migration. I recommend this to be posted in Laravel repo not here.