Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MySQL should use utf8mb4 instead of utf8 #513

Closed
thomaschaaf opened this issue Apr 25, 2020 · 3 comments
Closed

MySQL should use utf8mb4 instead of utf8 #513

thomaschaaf opened this issue Apr 25, 2020 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@thomaschaaf
Copy link
Contributor

Describe the bug
Currently you can not save emojis in the database with the default encoding setting.

Here is a blog post about it:
https://medium.com/@adamhooper/in-mysql-never-use-utf8-use-utf8mb4-11761243e434

@thomaschaaf thomaschaaf added the bug Something isn't working label Apr 25, 2020
@B4nan
Copy link
Member

B4nan commented Apr 25, 2020

There is no diffing support for this (and I am not planning to add it), so you can just change it manually on existing tables.

@thomaschaaf
Copy link
Contributor Author

But could the default be changed? I bet a lot of people don't know why saving emojis won't work for them. It would just have to be changed here right?

return 'set names utf8;\nset foreign_key_checks = 0;\n\n';
}
getSchemaEnd(): string {
return 'set foreign_key_checks = 1;\n';
}
finalizeTable(table: CreateTableBuilder): void {
table.engine('InnoDB');
table.charset('utf8');

@B4nan
Copy link
Member

B4nan commented Apr 25, 2020

Only thing that makes sense to change is the finalizeTable part. Sure we can make this configurable.

@B4nan B4nan closed this as completed in 82fa93d Apr 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants