Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#23920 closed Bug (fixed)

MySQL: migrate TextField() to TextField(blank=True) fails

Reported by: Waldemar Kornewald Owned by: Tim Graham
Component: Migrations Version: 1.7
Severity: Release blocker Keywords:
Cc: info+coding@… 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

When adding blank=True to an existing TextField and running manage.py makemigrations and manage.py migrate with MySQL I get the following error:

BLOB/TEXT column 'sometextfield' can't have a default value

BTW, why do changes to blank require new migrations?

Change History (7)

comment:1 Changed 4 years ago by Waldemar Kornewald

Type: UncategorizedBug

comment:2 Changed 4 years ago by Tim Graham

Severity: NormalRelease blocker
Triage Stage: UnreviewedAccepted

I could reproduce this.

As for your question, it's answered in the migrations docs.

comment:3 Changed 4 years ago by Tim Graham

Owner: changed from nobody to Tim Graham
Status: newassigned

comment:4 Changed 4 years ago by Tim Graham

Has patch: set

comment:5 Changed 4 years ago by Markus Holtermann

Cc: info+coding@… added
Triage Stage: AcceptedReady for checkin

comment:6 Changed 4 years ago by Tim Graham <timograham@…>

Resolution: fixed
Status: assignedclosed

In 765fa36d57d08d0568438f6fd74521e7a56abb61:

Fixed #23920 -- Fixed MySQL crash when adding blank=True to TextField.

Thanks wkornewald for the report and Markus Holtermann for review.

comment:7 Changed 4 years ago by Tim Graham <timograham@…>

In d57124433f0d0f2bf61ea4e14962f3b663ab20c7:

[1.7.x] Fixed #23920 -- Fixed MySQL crash when adding blank=True to TextField.

Thanks wkornewald for the report and Markus Holtermann for review.

Backport of 765fa36d57d08d0568438f6fd74521e7a56abb61 from master

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