I've got an existing Django project that I'm trying to add South to. I'm fine with losing ally my data (in fact, I've already dropped/created the database several times).
The problem is that I do the following:
(in psql
)
drop database myproject
create database myproject
(at the command line)
python manage.py syncdb --migrate
python manage.py schemamigration myproject.myapp --initial
python manage.py migrate myproject.myapp
Everything works great until I get to that last command; when I run it I get:
django.db.utils.ProgrammingError: relation "myapp_somemodel" already exists
(where "somemodel" is a model in myapp).
I've tried searching SO, but all the posts I found suggested the set of commands above. Can anyone please help me get South added to this project?
You need to run migrate
with --fake
option for your initial migration:
$ python manage.py migrate myproject.myapp 0001 --fake
Also see Converting An App chapter from South
docs.