Django south基础

6 篇文章 0 订阅
1 篇文章 0 订阅

./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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值