Search code examples
pythondjangodjango-southdjango-migrations

Is there an `update migration` (ala South) option for django.db.migrations?


In South there was a nice command:

schemamigration frontend --auto --update

Which would take the most recent (unapplied) migration and update it to match whatever change was in the model. It was really handy during dev.

Does the new django migrations module that was introduced in 1.7 have an option like that? Looking at the docs I suspect not: https://docs.djangoproject.com/en/1.7/ref/django-admin/#django-admin-makemigrations


Solution

  • in django >=1.7 there is nothing like this, but you also dont need it actually.

    if you make changes in your models, you can either edit the latest migration file if the changes are only defaul values, choices etc, and thats it or just makemigrations and migrate again.

    I personally find this way much more clear and easy to work with.