6

Django has a number of open source projects that tackle one of the framework's more notable missing features: model "evolution". Ruby on Rails has native support for migrations, but I'm curious if anyone can recommend one of the following Django "evolution" projects:

Huuuze
  • 12,958
  • 23
  • 65
  • 91
  • 1
    Great question!! I'm hoping to use something like migrations with Django too. – NathanD May 12 '09 at 15:25
  • Also see this question: http://stackoverflow.com/questions/426378/what-is-your-favorite-solution-for-managing-database-migrations-in-django although the favorited answer there is migratory, which has problems. – Van Gale May 13 '09 at 10:48

4 Answers4

10

South has the most steam behind it. dmigrations is too basic IMO. django-evolution screams if you ever touch the db outside of it.

South is the strongest contender by far. With the model freezing and auto-migrations it's come a long way.

tmc
  • 676
  • 6
  • 13
  • I was impressed by South, but I django-evolution looked interesting as well. Barring any more answers in the next couple hours, I'll go with this one. – Huuuze May 12 '09 at 17:16
  • If you're using an evolution tool you shouldn't touch the DB outside of it, so I don't see that as much of an argument. – Carl Meyer May 12 '09 at 17:59
5

South and django-evolution are certainly the best options. South's model-freezing and auto-hinting are still quite fragile in my experience (django-evolution's hinting is much more robust in edge cases), but django-evolution's development seems to have mostly stalled since last summer. If I were starting now I'd probably pick South, mostly for that reason.

Carl Meyer
  • 105,276
  • 18
  • 102
  • 113
2

After reading this, I went from 'knowing nothing about data model evolution' to 'using south to manage model migration' in less than 1 hour. South's documentation is outstanding and got me up to speed in record time. Not having looked at the other tools mentioned, I fully recommend it.

Update: Since posting this answer about a month ago, I went through several data model reviews, ranging from simple field renaming to completely replacing some tables by new ones. South can not do everything in a fully automated manner (e.g. a rename looks like delete & add), but the documentation guides you smoothly through the manual steps.

I will bring south into any future project. Fantastic tool!

ssc
  • 8,576
  • 8
  • 51
  • 84
1

I'm a member of the team that developed dmigrations - but I would wholeheartedly recommend South. It's much more mature, is under active development, and has some killer features like ORM freezing (if you try to use ORM code in dmigrations, then change your models, you're in for a world of pain).

Daniel Roseman
  • 541,889
  • 55
  • 754
  • 786