Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running South migrations for all apps

I've just begun using South and am still in the process of figuring it out. Let's say I have the initial migration script of a model. Then i go add a column to the model and create a migration script for it. I then add another column to another model and create another migration script for it. I'm creating the migration script by running ./manage.py schemamigration myappname --auto.

Let's say I have a server on which my project is deployed but it was based on the initial schema of the application but now it lags behind the repository by two migrations. I can bring it up to date by running ./manage.py migrate myappname. This would bring that app's models up to date by running the the new migrations if I'm correct but I would explicitly have to specify the app.

Does South allow you run all pending migrations for all apps in a Django project? If so how? I haven't able to find any thing in the docs about this.

Thanks a ton everyone.

like image 209
Mridang Agarwalla Avatar asked Aug 24 '11 19:08

Mridang Agarwalla


2 Answers

To bring all apps up to date on all their migrations, run:

./manage.py migrate

Simple. :)

like image 158
Leopd Avatar answered Oct 19 '22 07:10

Leopd


You can also try:

./manage.py syncdb --migrate

to migrate all applications which use south and sync the applications which do not.

like image 24
iutinvg Avatar answered Oct 19 '22 06:10

iutinvg