Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I've been using the Django dev version (1.8) for a personal project for a while now. I really like the built in migration framework, which is available from this release (1.7). I think it's even easier and cleaner than South! Also the documentation is very clear (as always).

There's just two commands [0]:

    makemigrations - to create migrations
    migrate - to (un)apply migrations
Adding migrations to an existing app is just running the `makemigrations` command for that app [1]:

    python manage.py makemigrations your_app_label
It will create a migrations/ folder in the app folder and you're good to go. When you change your models and run `makemigrations` again, it will make migrations for the changes you made and you can apply them with the `migrate` command. For migrations that can't be detected automatically (like renaming models/fields) you can create an empty migration file (by supplying `--empty` to the `makemigrations` command) and edit the migration file yourself. With the great documentation this is easily done [2].

They also support data migrations (migration for the data in your database instead of the scheme of the tables). So I think it replaces pretty much all features of South. BTW, the original creator of South (Andrew Godwin) helped create the migration framework in Django, so no hard feelings ;).

[0] https://docs.djangoproject.com/en/1.7/topics/migrations/#two...

[1] https://docs.djangoproject.com/en/1.7/topics/migrations/#add...

[2] https://docs.djangoproject.com/en/1.7/ref/migration-operatio...



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: