spacebarchat / server

Spacebar server - A reimplementation of the Discord.com backend, built with Typescript and love
https://spacebar.chat
GNU Affero General Public License v3.0
1.47k stars 252 forks source link

Use UTF-8 for MySQL/MariaDB DBs by default #1178

Closed DEVTomatoCake closed 2 months ago

DEVTomatoCake commented 2 months ago

Modifies @Entity() statements to specify the charset and collation to be utf8mb4, to allow support for e.g. emojis which is especially important in messages.

Tested on MariaDB & Postgres (doesn't seem to have any impact).

No migration script currently because it's difficult to modify the charset of rows with foreign keys.

Reference on why per-entity instead of globally (TLDR: it doesn't work): https://github.com/typeorm/typeorm/issues/2175

Fixes #1154