Re: Setting defaults in the DB to support zero-downtime migrations

2018-04-08 Thread Ryan Hiebert
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

Setting defaults in the DB to support zero-downtime migrations

2018-03-22 Thread Paul Tiplady
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