Blank-able CharFields require default=''
|Reported by:||Yuval Adam||Owned by:||Andriy Sokolovskiy|
|Cc:||Simon Charette, Andriy Sokolovskiy||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:21 Changed 2 years ago by
|Patch needs improvement:||set|
|Triage Stage:||Ready for checkin → Accepted|