14th January, 2011

South commands

Quick note for Django South commands:

New app:

manage.py schemamigration app_name --initial
manage.py migrate app_name

Existing app:

First run on your development environment:

manage.py convert_to_south app_name

Then copy the migrations directory to any servers you want to migrate, and run:

manage.py migrate app_name 0001 --fake

Now for any subsequent migrations, on the development environment, run:

manage.py schemamigration app_name --auto
manage.py migrate app_name

Now you can copy your new migration files to the server and run:

manage.py migrate app_name

 

The opinions expressed here are my own and not those of my employer.