--
Ticket URL: <https://code.djangoproject.com/ticket/32805>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* Attachment "forecast.py" added.
* Attachment "0017_forecast_issued_at.py" added.
* Attachment "0018_auto_20210601_0946.py" added.
Comment (by Christos Georgiou):
In 0017 you AlterField to:
`field=models.DateTimeField(db_index=True, default=None, null=False),`
which doesn't make much sense (null=False and yet default=None).
Have you tried to remove the AlterField's `default=None` to see if still
0018 is produced by makemigrations?
--
Ticket URL: <https://code.djangoproject.com/ticket/32805#comment:1>
* status: new => closed
* resolution: => invalid
* component: Database layer (models, ORM) => Migrations
Comment:
Please don't use Trac as a support channel, this is a manually created
migration. To avoid creation of `0018_auto_20210601_0946.py` you can
change the `AlterField` to the:
{{{
migrations.AlterField(
model_name='forecast',
name='issued_at',
field=models.DateTimeField(db_index=True),
),
}}}
`default=None` is not the same as not providing a default.
Closing per TicketClosingReasons/UseSupportChannels.
--
Ticket URL: <https://code.djangoproject.com/ticket/32805#comment:2>
Comment (by Matthew Cornell):
Genius! Thanks very much.
Replying to [comment:1 Christos Georgiou]:
> In 0017 you AlterField to:
> `field=models.DateTimeField(db_index=True, default=None, null=False),`
> which doesn't make much sense (null=False and yet default=None).
> Have you tried to remove the AlterField's `default=None` to see if still
0018 is produced by makemigrations?
--
Ticket URL: <https://code.djangoproject.com/ticket/32805#comment:3>
Comment (by Matthew Cornell):
Thank you. Apologies.
Replying to [comment:2 Mariusz Felisiak]:
> Please don't use Trac as a support channel, this is a manually created
migration. To avoid creation of `0018_auto_20210601_0946.py` you can
change the `AlterField` to the:
> {{{
> migrations.AlterField(
> model_name='forecast',
> name='issued_at',
> field=models.DateTimeField(db_index=True),
> ),
> }}}
>
> `default=None` is not the same as not providing a default.
>
> Closing per TicketClosingReasons/UseSupportChannels.
--
Ticket URL: <https://code.djangoproject.com/ticket/32805#comment:4>