SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes (Connection: mysql, SQL: alter table
personal_a ccess_tokens
add indexpersonal_access_tokens_tokenable_type_tokenable_id_index
(`tokenable_
I tried to add index with the specified key length
$table->index(['tokenable_type', 'tokenable_id'], 'tokenable_index');
but still encountering the error
2
Answers
You can try shorten column name like this
$table->index([‘type’, ‘tokenable_id’], ‘tokenable_index’);