Skip to content

Instantly share code, notes, and snippets.

@corean
Created May 26, 2018 06:01
Show Gist options
  • Select an option

  • Save corean/2296faf1c8f76eab0715a89f5827c91f to your computer and use it in GitHub Desktop.

Select an option

Save corean/2296faf1c8f76eab0715a89f5827c91f to your computer and use it in GitHub Desktop.
Specified key was too long; max key length is 767 bytes
/*
[Illuminate\Database\QueryException]
SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes (SQL: alter table users add unique users_email_unique(email))
[PDOException]
SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes
*/
use Illuminate\Support\Facades\Schema;
public function boot()
{
Schema::defaultStringLength(191);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment