Opened 8 years ago

Closed 8 years ago

#26966 closed Bug (fixed)

MySQL backend schema editor skip_default method requires update for MySQL 5.7

Reported by: conor Owned by: nobody
Component: Database layer (models, ORM) Version: 1.9
Severity: Normal Keywords: mysql, mysql 5.7, jsonfield, backend, db
Cc: me@… Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Currently this method, django.db.backends.mysql.schema.DatabaseSchemaEditor.skip_default, checks for a certain group of field types (texts and blobs) to determine whether defaults are applicable at the database level. Since MySQL 5.7, there is one more which I believe needs to be added to this list - the new 'json' type. I discovered this while working with the django-mysql module. In that module a default of dict is set at the Django model level but needs to be ignored for database operations.
As far as I can see it should be a pretty straight forward fix as I can't see why it would interfere with the functionality for older versions of MySQL.

Change History (5)

comment:1 by Adam Johnson, 8 years ago

Cc: me@… added

comment:2 by Tim Graham, 8 years ago

Triage Stage: UnreviewedAccepted

comment:4 by Claude Paroz, 8 years ago

Triage Stage: AcceptedReady for checkin

comment:5 by Tim Graham <timograham@…>, 8 years ago

Resolution: fixed
Status: newclosed

In 4b1c9708:

Fixed #26966 -- Made MySQL backend skip defaults for JSON columns

Thanks mcgeeco for reporting, and claudep and timgraham for review.

Note: See TracTickets for help on using tickets.
Back to Top