[英]Set default value on migration Django/South?
Is Django 1.6 with South 0.8 going to set default value when I add a column with default
value to existing data having the field described like this? 当我将具有default
值的列添加到具有这样描述的字段的现有数据中时,带有South 0.8的Django 1.6会设置默认值吗?
gametype = models.PositiveSmallIntegerField(_('type of game'),
choices=CONST_TYPES,
default=CONST_TYPE_NORMAL,
null=True, blank=True)
I am worrying about having null=True
at the same time with default
specified 我担心同时将null=True
与default
指定
It depends on whether gametype is a new field or not. 这取决于游戏类型是否为新字段。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.