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?
South documentation South is a tool to provide consistent, easy-to-use and database-agnostic migrations for Django applications.
Migrations are Django's way of propagating changes you make to your models (adding a field, deleting a model, etc.) into your database schema. They're designed to be mostly automatic, but you'll need to know when to make migrations, when to run them, and the common problems you might run into.
The migrate command is new in the upcoming Django 1.7, which hasn't been released yet. For earlier versions you can use syncdb , or the external app South. When you're reading the documentation, use the Documentation version switcher to select the correct version.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With