Hi all,
Some thoughts on schema migrations that may interest you. By way of background, I'm the author of migra (
https://github.com/djrobstep/migra), a schema comparison/diff tool for Postgres.
I initially wrote this tool because I wanted to be able to generate migration scripts automatically, without needing historical migration files.
It means that you can do things like sync your database to your models mostly automatically, and also explicitly test for a matching schema. Instead of a chain of migration files you only ever need to keep track of one, containing any pending changes).
I've used this approach with success on a number of projects now, and it seems to work pretty well. I also talked about this approach to migrations at the most recent PostgresOpen (
https://www.youtube.com/watch?v=xr498W8oMRo).
The downside of this approach is that it's slightly more operationally complex (you need have a temporary copy of your production schema available for comparison purposes, typically a --schema-only dump file) and also that it's postgres-only at this point. It's also conceptually quite different to the typical Django/Rails style of migrations which represents a barrier to entry.
In spite of this, I think doing migrations this way has some compelling advantages, that are relevant to users of Django.
I'm interested in your opinions on this topic as Django developers. What do you think? Is it something worth offering as an option for managing Django migrations? If your feelings are positive, I'm happy to take a look at extending the code accordingly.