django/django — pull request #3314 by ChangeSomeCode (2014-10-06 15:16:43+00:00)
Title: movable django migrations

Hello, it would be nice, if we be able to move the migration from one application to another.

For example, we have local app with FooModel:

class FooModel(models.Model):
first_field = models.CharField(max_length=255)
second_field = models.CharField(max_length=255)

and some third-party app with BazModel.
If we want add new field to BazModel in the our project, we use method contribute_to_class in foo.models:

models.ManyToManyField(FooModel, blank=True, null=True).contribute_to_class(BazModel, 'foo_field')

New migration added to /path_to_third_party_app/migrations/, and we move it to /path_to_proj/foo/migrations/. It need to store changes in models of third-party applications in project.