-
-
Notifications
You must be signed in to change notification settings - Fork 87
Error "Column length too big for column 'description'" on MySQL backend #672
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
Comments
Thanks for the bug report - can you check if #673 fixes the issue for you? |
Now I'm getting the following:
|
Could you try with a smaller number and see what works? |
Not sure if you were asking to change the same 2 lines as #673, but I did it anyway:
With that value the migration
|
Do any of the solutions here help? https://stackoverflow.com/questions/29782081/django-db-utils-operationalerror-1071-specified-key-was-too-long-max-key-le |
I went through (almost) all of the presented solutions and none of them worked.
If I change it to
|
Can you run |
Sure, here are the tables after these changes:
|
Every comment I made in this thread has been with a fresh MySQL database, but I just made a fresh clone of As of right now, I'm using the
Since I'm installing from source, maybe I'm missing a step? Here is my Dockerfile. |
I am using mariadb and don't see the issue:
I will try to reproduce with your version. Can you reduce the max_length of the URLField in the migration and see if that helps? |
I changed the line you suggested on
Only for it to hang on
Next, I changed
This took the process to the next step, showing the error on
However, I can't find any migration file on |
Ah, it looks like it's creating a migration for the change. So you'd need to change the max_length in both the model and migration so they are matching, then it won't create a new migration. |
That worked, the process completed successfully! Here is the (truncated)
|
Awesome, thanks for testing! Could you also test what is the highest possible value there? I chose 2000 based on https://stackoverflow.com/questions/417142/what-is-the-maximum-length-of-a-url-in-different-browsers/417184#417184 so would like to avoid truncating, and breaking, URLs if that is possible... |
While running some tests for PR #670, I noticed I'm not able to successfully run
manage.py migrate --run-syncdb --fake-initial
with a MySQL backend. The following error appears:This is a clean install from source and I tested this with MySQL 8 and 9, same result on both versions. The command
manage.py makemigrations
always returnsNo changes detected
.The command runs successfully with SQLite, by the way, just not with MySQL.
The text was updated successfully, but these errors were encountered: