我遇到了评论者提出的同样问题:Django South - 表已经存在
没有后续行动,所以我想我会发一个新问题.我有一个Django应用程序,我在南方管理它的迁移.我在模型中添加了一个字段然后运行
./manage schemamigration my_app --auto
Run Code Online (Sandbox Code Playgroud)
按预期运行.运行
./manage migrate my_app
Run Code Online (Sandbox Code Playgroud)
但是,导致错误,表明与我更改的模型关联的表已经存在.这导致我上面的链接问题,所以运行
./manage migrate my_app --fake
Run Code Online (Sandbox Code Playgroud)
解决了表错误,但现在我收到一个Django错误,表明与新字段关联的列不存在.
./manage sqlall my_app
Run Code Online (Sandbox Code Playgroud)
显示架构符合预期.
任何关于如何补救这一点的想法都表示赞赏!
我有一个新的Django 1.3项目和我创建的应用程序.我向南添加了我settings.py还没有跑syncdb.当我按照南方教程和文档执行以下命令时,我收到了如下所示的错误.
$ python ./manage.py schemamigration qexpenses --initial
Creating migrations directory at '/Users/matthew/development/quest-projects/qexpense-tracker/quexptrkr/../quexptrkr/qexpenses/migrations'...
Creating __init__.py in '/Users/matthew/development/quest-projects/qexpense-tracker/quexptrkr/../quexptrkr/qexpenses/migrations'...
+ Added model qexpenses.Buyer
+ Added model qexpenses.Vendor
+ Added model qexpenses.Department
+ Added model qexpenses.Project
+ Added model qexpenses.PurchaseType
+ Added model qexpenses.PurchaseOrder
Created 0001_initial.py. You can now apply this migration with: ./manage.py migrate qexpenses
(qexpense-tracker)matthew@Matthew-Rankins-MacBook-Pro:~/development/quest-projects/qexpense-tracker/quexptrkr
$ python ./manage.py migrate
Traceback (most recent call last):
File "./manage.py", line 14, …Run Code Online (Sandbox Code Playgroud) 我已经做了:
python manage.py schemamigration TestDBapp1 --initial
python manage.py schemamigration TestDBapp1 --auto
Run Code Online (Sandbox Code Playgroud)
成功.
但如果我输入: python manage.py migrate TestDBapp1
我明白了: sqlite3.OperationalError: table "TestDBapp1_xyz" already exists
可能是什么问题呢?