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
db migrate error with utfmb4 #302
Comments
Thanks for reporting this. Do you have the log messages that occurred before this error? We'll need to know which migration this occurred on. Also, which version of MySQL are you running? |
MariaDB 10.1.44 Sorry, I did not keep the log. I wanted to try out the 0.12rc1 and had the reported error. As I did not have anything of value, I started out from a clean database (using utf8 this time...) |
Could you try running it again and giving the full logs? And then can you set your database character set to Either way, we'll need more information to determine if this is a bug we can / should fix. |
I am right now in the middle of upgrade to |
Thanks for including the logs, @kushaldas. Is your database also configured for utf8mb4? |
Let me try to figure that out, do you have the command handy to get that information? |
Yep: USE writefreelydatabasename;
SELECT @@character_set_database, @@collation_database; |
|
Thanks, so this does seem to be the same issue. I'll update our installation and upgrade docs to make sure this works in the future. But for your case, this database change should fix it: ALTER DATABASE writefreelydatabasename CHARACTER SET latin1 COLLATE latin1_swedish_ci; And then you can run |
@thebaer next error while trying to migrate again:
|
This last query should fix that: DROP TABLE oauth_users; (You won't lose any data since this new table was part of the |
Problems solved. Thank you @thebaer. |
Awesome! Happy to help. I've adjusted the upgrade instructions in our v0.12.0 notes, as well as on the install guide. So I'll close this issue now. |
while the latin1 character set may not cause problems, I'd suggest moving towards instructions that let mysql also handle things in full utf-8 mode. Granted, utf-8 in mysql is not the easiest, but it gets better over time. The The direct error can be solved by different means (limiting the index prefix or upgrading to newer versions of mysql/mariadb and setting the parameter) but not having full utf-8 encoding in the database does not sound like the right direction. I've been running writefreely in 'full utf-8', i.e. using |
Agreed there could definitely be something else at play here... So you haven't seen the same issue with your database config? I'd like to know more about the upsides / downsides of getting everything on UTF-8 before changing over. Right now we use |
So you haven't seen the same issue with your database config?
No, I haven't seen that particular issue on wf, but I paid
specific attention to it when setting up the database, because I
*have* seen it on many, many other databases I had. ;-)
Is the current stanza: "latin1 unless we need utf-8 ..."?
If so, was this just because of the disk space savings? Are there
actual relevant savings here with mysql or are they just
theoretical? (I would be a bit surprised if there were very
significant differences given the overhead of mysql, but I may be
wrong.)
Are there other considerations to take latin1 as the default?
The main advantage would be simplicity and compatibility in my
view. Assuming utf-8 everywhere is a simple rule and easy to work
with. There's no administrative overhead keeping track of what
needs to be encoded how and instructions / limitations can be
simple: "Support utf-8 everywhere".
|
I tried to upgrade to v0.12.0rc1
"db migrate" gives the error
ERROR: 2020/04/19 17:16:57 main.go:121: migrate: Error 1709: Index column size too large. The maximum column size is 767 bytes.
I suspect this is due to my mysql being setup in utf8mb4.
The text was updated successfully, but these errors were encountered: