django-mysql
django-mysql copied to clipboard
charset + collation transformer (fix utf8mb4)
Add a command that does ALTER DATABASE, and ALTER TABLE as required to change character set for the database from utf8 to utf8mb4, or rather, from any arbitrary charset + collation to any other.
Don't forget to remove the note in the checks docs about this being WIP.
@adamchainz: I've put together a management command for this that I'm currently testing internally. This isn't a "help wanted" ticket, so I thought I'd check if you were interested in it before submitting a PR.
Yes please send a PR! The tags are only loose and not up to date. Just beware I won't be able to review it for a couple weeks though.
On Thursday, 25 August 2016, Nick Meharry [email protected] wrote:
@adamchainz https://github.com/adamchainz: I've put together a management command for this that I'm currently testing internally. This isn't a "help wanted" ticket, so I thought I'd check if you were interested in it before submitting a PR.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/adamchainz/django-mysql/issues/216#issuecomment-242557549, or mute the thread https://github.com/notifications/unsubscribe-auth/AA0WCfrl0LW_IUaAI2zooMaPjsL9jgk4ks5qjhF4gaJpZM4HQ0pS .
Adam
Hi
Such a management command would be really great to have ! @nickmeharry are you still considering submitting a PR with this ?
@thomasfillon This had moved to the back burner for me, but I should have that command sitting around here somewhere. Last I recall, I got stuck on dealing with indexes becoming too long after changing the byte size of CharField columns. I'll poke at it again this week.
@nickmeharry Ok great ! Thank you .
See also https://code.djangoproject.com/ticket/18392
The index length problem you mention seems to describe there:
"InnoDB has a maximum index length of 767 bytes, so for utf8 or utf8mb4 columns, you can index a maximum of 255 or 191 characters, respectively. If you currently have utf8 columns with indexes longer than 191 characters, you will need to index a smaller number of characters.
I've cleaned up my management command and submitted a pull request: #356
Not gonna do this.
@adamchainz Hi Adam! Can you elaborate on why this change was closed? Are there plans to support such command in the future?
It's a valid case that I'm currently researching and the command is exactly what I need.
See #959