matkk
matkk

Reputation: 115

django-south migration order

South run migrations per app not in order migrations where created. This may cause some problem with dependencies between migrations. Sometimes it's needed to add depends_on attribute to migration class.

Is it possible to run south-migration in order they were created? And also, anyone know reason why south is doing it this way?

Upvotes: 10

Views: 2664

Answers (1)

Benjamin Wohlwend
Benjamin Wohlwend

Reputation: 31828

South has no idea in what order you created migrations between multiple apps. It could look at the file system metadata, but that would break horribly with 3rd party apps installed through a package manager, or when you deploy your app.

The depends_on and needed_by attributes where made exactly for this use case, so use them for that. See also http://south.readthedocs.io/en/latest/dependencies.html.

Upvotes: 19

Related Questions