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

Опубликовано: 16 Февраль 2025
на канале: Simple solution
7,875
109

Laravel migration: the unique key is too long, even if specified
'charset' utf8',
'collation' utf8_unicode_ci

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`))

Illuminate\Database\QueryException
SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytemail`))

PDOException::("SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long;