When using utf8mb4 encoding characters can be 1,2,3 or 4 bytes long.
Mysql unique indexes only can index a maximum of 767 bytes which results in a incorrect length for unique keys:
SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes: CREATE TABLE
{minifyjs_file} (
`fid` INT unsigned NOT NULL auto_increment COMMENT 'The file id of the javascript file.',
`uri` VARCHAR(255) NOT NULL COMMENT 'Original file uri.',
`size` INT unsigned NOT NULL COMMENT 'Original file size.',
`modified` INT unsigned NOT NULL COMMENT 'Original file last modified date.',
`minified_uri` VARCHAR(255) DEFAULT '' COMMENT 'Minified file uri.',
`minified_size` INT unsigned DEFAULT 0 COMMENT 'Minified file size.',
`minified_modified` INT unsigned DEFAULT 0 COMMENT 'Minified file last modified date.',
PRIMARY KEY (`fid`),
UNIQUE KEY `uri` (`uri`)
) ENGINE = InnoDB DEFAULT CHARACTER SET utf8mb4 COMMENT 'Store a list of all javascript files and their minified…'; Array
(
)
The maximum length should be 191 when using utf8mb4 encoding.
Comments
Comment #2
kevinvb commentedThis patch fixes the installation issue.
Comment #3
slydevil commentedOut of the box, the longest file name is 129 for drupal 8, so a length of 191 should be more than enough. Thanks!
Comment #5
slydevil commentedComment #6
slydevil commented