In Django-South:
I changed I’ve run the initial migration successfully for myapp but for some reason, after I’ve made a change to my model and go to
./manage.py schemamigration myapp --auto
./manage.py migrate myapp
And I get a lot of traceback which ends in:
(1050, "Table 'my_table' already exists")
After much googling, I found and tried this:
./manage.py migrate myapp --fake
And then I proceed to migrate it, to no avail; same error.
Any suggestions?
I just got this same error, and found this question by search.
My problem was that my second migration I’d created using the
--initialflag, i.e.… make some changes to foo …
(oops!)
… and I get the error, and the migration fails because in the second migration, South is trying to create a table its already created.
Solution
In my migrations folder:
remove that second migration and re-export the second migration with the correct
--autoflag:Success!
There may be other things that cause this error, but that was my bad!