south django migrate

自作多情 提交于 2019-12-06 04:01:51

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/3567256/south-django-migrate

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!