mardi 18 août 2020

1071 specified key was too long; max key length is 1000 in laravel

I have a migration something like this:

 Schema::create('migration1', function (Blueprint $table) {
 $table->increments('id');
 $table->string('endpoint',500)->unique();

when i run migration i'm getting:

1071 specified key was too long; max key length is 1000

in my boot method i have :

  public function boot()
    {
        Schema::defaultStringLength(191);
    }


via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire