I've found other places where things are fiddly for production migrations
as well. Migrating a nullable to a non-nullable field is one of a range of
cases where the migration cannot be run until the code has been fully
deployed to no longer write nulls to the database. A similar case, that's
even a
It can be quite fiddly to support zero-downtime DB migrations in Django.
For example see
https://dev.mysql.com/doc/refman/5.7/en/data-type-defaults.html for tricks
in Postgres; I'll refer to MySQL herein.
In general the sequence is to first upgrade the DB schema to the new
version, while keepi