#32925: TextField default text not populate to MySQL data when migrate
-------------------------------------+-------------------------------------
Reporter: Edgenius | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: 3.2
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by Edgenius:
Old description:
> 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.
New description:
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.
--
--
Ticket URL: <https://code.djangoproject.com/ticket/32925#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/068.f272311c0c67cd271b774f70178fd6ea%40djangoproject.com.