chore: enforce USE_TZ setting expectations in migrations#4386
Conversation
|
This is a developer-convenience bit of tooling? Or are you anticipating that the production release will require a step where migrations fail and then have to be rerun after changing USE_TZ manually? |
|
It was motivated for developer convenience. For production, we will need to arrange for the The guards I've put in here are ok to warn that you've probably already corrupted your timestamp data, but outside of dev that's of limited value. There's really no robust way to manage a change in the |
This pull request resets
USE_TZ=Falseinsettings.py. This is needed so that migrations before the timestamp conversion can be run on dev systems.A check that
USE_TZis stillFalseis added to the timestamp conversion migration. That setting must not be changed until after we migrate the DB.An additional dummy migration is added after timestamp conversion. This will fail, interrupting migrations so the admin can update the
USE_TZsetting toTrueat the correct point in the sequence.