Best practices for database migrations

Edmund von der Burg evdb at ecclestoad.co.uk
Mon Nov 18 14:13:52 GMT 2013


On 18 November 2013 02:01, Simon Wistow <simon at thegestalt.org> wrote:
> Is there a current favourite for doing database migrations (i.e having a
> programatic way for a database to upgraded to a new version by having a
> series of sql commands run on it)?

I gave this a fair bit of thought a fair while ago, resulting in
http://www.slideshare.net/evdb/elegant-database-modifications-presentation

Basically I don't think that there are any "turnkey" solutions, but
rather as Abigail says only specific solutions.

However the Python/Django crowd do have
http://south.readthedocs.org/en/latest/about.html which is probably
90% of the solution for 99% of the likely scenarios. I suspect it is
similar to the active record approach, and well worth a look by anyone
proposing to create a database migration toolset, especially the easy
rollback support.

Another alternative is to not do database migrations, and use a
schemaless database. Then you get to have a whole new set of
interesting and exciting problems :)

Cheers,
  Edmund.


More information about the london.pm mailing list