Django south基础

./manage.py schemamigration southtut --initial
看了一下,项目里是老版本,使用
$ python manage.py startmigration contact --initial

Creating migrations directory at '/home/fruitschen/workspace/ixxyenv/lily_test/myproject/contact/migrations'...
Creating __init__.py in '/home/fruitschen/workspace/ixxyenv/lily_test/myproject/contact/migrations'...
 + Added model 'contact.Contact'
 + Added model 'contact.Organization'
 + Added M2M 'contact.Contact.organization'
 + Added M2M 'contact.Contact.events'
Created 0001_initial.py.

变更models之后
$ python manage.py startmigration contact 0002_add_xxx_field --auto

假想同事
svn update
$ python manage.py migrate

详细文档:
http://south.aeracode.org/docs/tutorial/part1.html

将一个现有的app转为使用south管理,一定要在数据库和db table能够对应的情况下执行。
如此说来所有的程序员都必须在一个版本上转换,否则migrations会冲突。

./manage.py convert_to_south contact

你可能感兴趣的:(实践,Django,第三方库,django,python,数据库,table,文档,svn)