I have a migration file for my php project. I am getting this error
Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes
I do understand this issue is due to varchar(512) and charset - UTF8 but how do I solve this? I cannot change in my migration script. Can I change some properties in my.ini of MySql?
CREATE TABLE if not exists usermaster (
user_id bigint(20) NOT NULL,
username varchar(512) NOT NULL,
PRIMARY KEY (user_id,username),
KEY fk_um_idx (user_id),
CONSTRAINT fk_um_idx FOREIGN KEY (user_id) REFERENCES users (user_id) ON DELETE CASCADE ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8;