我有一个mysql数据库。我想添加更多列,所以我开始使用南方。我想将我的数据库设置为使用南。我该怎么做?
我按照1054 unknown column django after south migration的步骤无效
模型没有变化
(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'")
任何人都知道如何避免此错误?