1

我有一个mysql数据库。我想添加更多的列,所以我开始使用南。我想将我的数据库设置为使用南。我该怎么做呢?

在南迁移后按照 1054 unknown column django的步骤无济于事

尚未更改模型

(venv)sfo-mpmgr:summertime msmith$ python manage.py convert_to_south livestream
Creating migrations directory at '/Users/msmith/Documents/dj/summertime/livestream/migrations'...
Creating __init__.py in '/Users/msmith/Documents/dj/summertime/livestream/migrations'...
 + Added model livestream.Stream
Created 0001_initial.py. You can now apply this migration with: ./manage.py migrate livestream
 - Soft matched migration 0001 to 0001_initial.
Running migrations for livestream:
 - Migrating forwards to 0001_initial.
 > livestream:0001_initial
   (faked)

App 'livestream' converted. Note that South assumed the application's models matched the database
(i.e. you haven't changed it since last syncdb); if you have, you should delete the livestream/migrations
directory, revert models.py so it matches the database, and try again.



(venv)sfo-mpmgr:summertime msmith$ python manage.py schemamigration livestream --auto
Nothing seems to have changed.


(venv)sfo-mpmgr:summertime msmith$ python manage.py migrate livestream --fake
Running migrations for livestream:
- Nothing to migrate.
- Loading initial data for livestream.
Installed 0 object(s) from 0 fixture(s)


(venv)sfo-mpmgr:summertime msmith$ python manage.py migrate livestream
Running migrations for livestream:
- Nothing to migrate.
 - Loading initial data for livestream.
Installed 0 object(s) from 0 fixture(s)

现在我用新属性更新模型。

(venv)sfo-mpmgr:summertime msmith$ python manage.py schemamigration livestream --auto
DatabaseError: (1054, "Unknown column 'livestream_stream.step' in 'field list'")

有谁知道如何避免这个错误?

4

0 回答 0