Don't use syncdb
and migrate
at the same time; this will conflict as the initial migration will create a blank table.
If you have a new app and want to have it managed by south, your sequence of operations is:
./manage.py schemamigration landing --initial
-- this creates the initial migration, which creates the tables for the application. You only do this once../manage.py migrate landing
-- this will apply the migration. The first time you do this (with step #1 from above), this will create an empty table in the database.
Once you have done the first two steps, whenever you make a change to your model, you run these two commands:
./manage.py schemamigration landing --auto
-- this will create the file that has the changes to your model (the migration)../manage.py migrate landing
-- this will apply the new migration (this is the same command from above); and it will affect the changes to your database.
If you already have an existing application, install south and run syncdb
to create south's own database tables, then run ./manage.py convert_to_south yourappname
; this will do a "fake" migration and set it to the last state of the models. Then, follow the schemamigration yourappname --auto
and migrate
steps.
In your case, you have two options:
Drop the table (as the error suggests). This will get rid of all the data as well. If you are in development, this is the easiest way to get started fresh (you should also use fixtures if you want to provide some default data for your models).
You can use the
--fake
option to trick south into thinking the operation has been done already. See the documentation for more.