Fix or document inconsistent handling of field defaults by migrations
If I create a model with the field
my_field = models.CharField(max_length=200, default='Foo'), there won't be a default set at the database level:
question character varying(200) NOT NULL. If I have that same field without a
default, but then add one in a migration, a default will be created in the database:
question character varying(200) NOT NULL DEFAULT 'Foo'::character varying. I think a default shouldn't be set in the latter case because we generally can't transform callable defaults into database defaults.
Change History (5)
Andrew Godwin Shai Berger added