Opened 3 years ago

Closed 3 years ago

Last modified 2 years ago

#33169 closed Bug (invalid)

Migrations crashes with long identifiers on MySQL. — at Version 5

Reported by: Awais Qureshi Owned by: nobody
Component: Migrations Version: 3.2
Severity: Normal Keywords: django32, mysql8.0.26
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Awais Qureshi)

I am trying to upgrade the project from django22 to 32.
Migrate command gives me this error

django.db.utils.OperationalError: (1059, "Identifier name 'blackboard_blackboardlearnerassessmentdatatransmissionaudit_chk_1' is too long")

I did't find any information related to this change in django32 release notes.

Important point: class BlackboardLearnerAssessmentDataTransmissionAudit(models.Model) is model name and app name is blackboard also.

Change History (5)

comment:1 by Mariusz Felisiak, 3 years ago

Resolution: needsinfo
Severity: Release blockerNormal
Status: newclosed
Summary: migrations fails to run on django32 with mysql5.7Migrations crashes with long identifiers on MySQL.
Type: UncategorizedBug

Thanks for this report, however I don't think you've explained the issue in enough detail to confirm a bug in Django. blackboard_blackboardlearnerassessmentdatatransmissionaudit_chk_1 is longer than the maximum identifier name on MySQL. Are you using the built-in backend for MySQL? Can you provide a minimum project to reproduce?

I didn't find any information related to this change in django32 release notes.

Have you checked release notes for Django 3.0 and 3.1?

comment:2 by Awais Qureshi, 3 years ago

I am using mysqlclient==2.0.3 and all django defaults packages/backends.

Yes I have checked django30 and 31 release notes, but no information available with this change. Same migration is working fine in django22.

blackboard_blackboardlearnerassessmentdatatransmissionaudit_chk_1 it has 65 characters but seems fine with django22.

comment:3 by Mariusz Felisiak, 3 years ago

... it has 65 characters but seems fine with django22.

This error is not raised by Django, but by MySQL. Can you provide a minimum project to reproduce?

comment:4 by Jacob Walls, 3 years ago

Have you verified the model field referred to is still in your project? I can produce your error if I'm executing a previously written migration but where the field is no longer in my project. Instead, if the field is in my project, I get this upon migrate:

SystemCheckError: System check identified some issues:

ERRORS:
x.xxxx: (models.E018) Autogenerated column name too long for field "blackboard_blackboardlearnerassessmentdatatransmissionaudit_chk_1". Maximum length is "64" for database "default".
        HINT: Set the column name manually using 'db_column'.

This system check predates 2.2, so if the field is in your project and no system check is raised, that would be a false negative to address. But we would need a minimal project to verify that the field exists.

comment:5 by Awais Qureshi, 3 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.
Back to Top