When I try to run a migration in Laravel, the following error is generated:
[Illuminate \ Database \ QueryException] SQLSTATE [HY000]: General Error: 1709 Index column size too large. The maximum column size is 767 bytes. (SQ L: alter table
usuarios
add uniqueusuarios_email_unique
([PDOException] SQLSTATE [HY000]: General error: 1709 Index column size too large. The maximum column size is 767 bytes.
The sql that is running is this:
create table 'usuarios' (
'id' int unsigned not null auto_increment primary key,
'nome' varchar(255) not null,
'email' varchar(255) not null,
'password' varchar(255) not null,
'nivel_id' int unsigned not null,
'empresa_id' int unsigned not null,
'departamento_id' int unsigned null,
'cargo_id' int unsigned null,
'status' tinyint(1) not null default '1',
'created_at' timestamp null,
'updated_at' timestamp null)
default character set utf8mb4 collate utf8mb4_unicode_ci
alter table 'usuarios' add unique 'usuarios_email_unique'('email')
alter table 'usuarios' add index 'usuarios_password_index'('password')
What might be causing this?