views:

1267

answers:

5

I quite like Rails' database migration management system. It is not 100% perfect, but it does the trick. Django does not ship with such a database migration system (yet?) but there are a number of open source projects to do just that, such as django-evolution and south for example.

So I am wondering, what database migration management solution for django do you prefer? (one option per answer please)

+1  A: 

I like django-evolution:

pros:

  • clean design
  • no SQL needed
  • flexible
  • trivial to install
  • easy to use

cons:

  • migrations are not fixed in the codebase
  • a risk exists of accidently running a migration twice
MiniQuark
I don't think it's possible in the normal workflow to run a migration twice. When I run manage.py evolve --hint --execute, it applies the changes, running it second time does nothing.
TomA
+7  A: 

Migratory looks nice and simple.

mcella
Wow! I love it! Thanks.
MiniQuark
+1 Thank you for the link
As of September 2010, Migratory seems to be dead. No source commits since January 2009, and it's expecting stuff in Django which is no longer there in the most recent release.
Simon
+3  A: 

We use Django at work, and we've been using dmigrations. While it has its quirks, it's been useful so far. Some features:

  • It uses a table in the database to keep track of which migrations have been applied.
  • Because it knows which ones have been applied, you can migrate up and back down.
  • It integrates with manage.py as a command.
  • The individual migration scripts are Python, but if your migration logic is pure SQL, dmigrations makes it easy to just can the SQL and have it executed.

One problem is that it only currently supports MySQL. However, one of our guys make a local hack to it to support PostgreSQL, which we use. As I recall, the hack wasn't all that extensive, so it shouldn't be terribly difficult to hack it up to support other RDBMSs.

Brian Clapper
+12  A: 

I've been using South, but Migratory looks promising as well.

akaihola
+1  A: 

Besides South, dmigrations, django-evolution, and Migratory I thought I would add simplemigrations as another tool I've seen for automating Django migrations.

I've used three of these in the past but do migrations by hand now. I'm thinking about trying South again due to the latest features added.

Van Gale