Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

south django migrate

I just did:

python manage.py schemamigration TestDBapp1 --initial
python manage.py schemamigration TestDBapp1 --auto

Successfully.

But if I enter: python manage.py migrate TestDBapp1

I get this: sqlite3.OperationalError: table "TestDBapp1_xyz" already exists

What could be the problem?

like image 570
MacPython Avatar asked Aug 25 '10 15:08

MacPython


1 Answers

I suspect that you already executed syncdb which created the tables. South tries to create them again during migrate and naturally the database complains.

To avoid this you have to tell South to "fake" the initial migration.

python manage.py migrate TestDBapp1 --fake

As the name indicates this pretends to migrate. Note that this is an one time step. South will handle your future syncdb and migrate without requiring --fake.

like image 158
Manoj Govindan Avatar answered Oct 10 '22 21:10

Manoj Govindan