Changes between Initial Version and Version 1 of Ticket #33169, comment 11
- Timestamp:
- Jan 24, 2022, 11:11:44 AM (3 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #33169, comment 11
initial v1 1 1 It's not a django issue. as per mysql8.0 [https://dev.mysql.com/doc/refman/8.0/en/identifier-length.html] 2 2 3 `For constraint definitions that include no constraint name, the server internally generates a name derived from the associated table name. For example, internally generated foreign key and CHECK constraint names consist of the table name plus _ibfk_ or _chk_ and a number. If the table name is close to the length limit for constraint names, the additional characters required for the constraint name may cause that name to exceed the limit, resulting in an error.` 3 > For constraint definitions that include no constraint name, the server internally generates a name derived from the associated table name. For example, internally generated foreign key and CHECK constraint names consist of the table name plus _ibfk_ or _chk_ and a number. If the table name is close to the length limit for constraint names, the additional characters required for the constraint name may cause that name to exceed the limit, resulting in an error. 4 4 5 5 My model is as follows 6 6 {{{ #!python 7 7 class BlackboardLearnerAssessmentDataTransmissionAudit(models.Model): 8 8 enterprise_course_enrollment_id = models.PositiveIntegerField( … … 11 11 db_index=True 12 12 ) 13 13 }}} 14 14 In mysql8 it generate this query with a check `enterprise_cou_enrollment_id` integer UNSIGNED NOT NULL CHECK (`enterprise_cou_enrollment_id` >= 0) having this name `blackboard_blackboardlearnerassessmentdatatransmissionaudit_chk_1` ( 65 characters ) and it throws the error.