calzoneman / sync

Node.JS Server and JavaScript/HTML Client for synchronizing online media
Other
1.46k stars 235 forks source link

Explicitly use UTF8 encoding for media metadata table #863

Closed Xaekai closed 4 years ago

Xaekai commented 4 years ago

This resolves the ER_TOO_LONG_KEY error on creation of the media_metadata_cache table because databases that default to full 4-byte utf8mb4 encoding make the VARCHAR(255) id column larger than the maximum supported key binary length of 767 bytes by MySQL and MariaDB RDBMS's.

Resolves #860

Xaekai commented 4 years ago

Since this can only happen at initial server creation, I think adding code to detect malformed database just for this would be wasteful. The hoster should just DROP and CREATE the database again.