Blank-able CharFields require default=''
|Reported by:||yuvadm||Owned by:||coldmind|
|Cc:||charettes, coldmind||Triage Stage:||Accepted|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||yes|
There's a weird behavior in Django 1.7 migrations as opposed to 1.6 + South.
Consider a simple blank-able CharField:
comment = models.CharField(max_length=20, blank=True)
In Django 1.6 + South, adding a migration to add this field would auto-generate default='' in the migration. In Django 1.7 the migration now throws: "You are trying to add a non-nullable field 'test' to question without a default".
My understanding is that this is the proper convention for blank-able fields, and in that case the migrations need to support it properly.
Change History (29)
comment:1 Changed 2 years ago by bmispelon
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
comment:4 in reply to: ↑ 3 Changed 2 years ago by yuvadm
comment:7 Changed 2 years ago by yuvadm
- Owner changed from nobody to yuvadm
- Status changed from new to assigned
comment:16 in reply to: ↑ 15 Changed 21 months ago by coldmind
comment:20 Changed 21 months ago by timgraham
- Triage Stage changed from Accepted to Ready for checkin
comment:21 Changed 21 months ago by timgraham
- Patch needs improvement set
- Triage Stage changed from Ready for checkin to Accepted
Changed 21 months ago by coldmind
comment:22 Changed 21 months ago by Tim Graham <timograham@…>
- Resolution set to fixed
- Status changed from assigned to closed