Extract() isn't safe to use in db_default on SQLite if TIME_ZONE changes at some point

If we also want to cover the case of changing TIME_ZONE during the lifetime of the project we could adjust Extract.deconstruct to prevent not providing a tzinfo (through a deprecation period) and then adjust it to return tzinfo=get_current_timezone() when not provided.

This would ensure that the timezone is always captured in the migrations file and if it ever change in the future the adequate operations would be generated.

I see it as a distinct problem than the db_default one though.

2 Likes