Opened 3 years ago

Last modified 3 years ago

#32925 closed Bug

TextField default text not populate to MySQL data when migrate — at Version 1

Reported by: Edgenius Owned by: nobody
Component: Database layer (models, ORM) Version: 3.2
Severity: Normal Keywords:
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 Edgenius)

When adding 2 new fields, one is CharField and another is TextField, they both nullable with default value:

subject2 = models.CharField(max_length=512, blank=True, null=True, default="Some text")
body2 = models.TextField(blank=True, null=True, default="Some text")

After migration in MySQL 8.0.19, for existing data, new CharField column populate that default "Some text" value. However, TextField is just null. This inconsistent behaviour is very confusing.

Django version is 3.2.5.

Change History (1)

comment:1 by Edgenius, 3 years ago

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