我在 1.7 版上观察到了这种行为,但在使用南迁移的以前版本中没有。
例如。
class RedemptionCode(models.Model):
EXPIRE_OPTIONS = (
('1 week', '1 Week'),
)
expire_option = models.CharField(max_length=255, choices=EXPIRE_OPTIONS)
当我添加更多选项时:
EXPIRE_OPTIONS = (
('1 week', '1 Week'),
('2 weeks', '2 Weeks'),
('1 month', '1 Month'),
('1 day', '1 Day'),
)
并运行makemigrations
,它为它创建了一个迁移,来自south
后台我认为它应该说没有检测到更改,因为它不会影响数据库模式。我不知道它有什么用途:
class Migration(migrations.Migration):
dependencies = [
('credits', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='redemptioncode',
name='expire_option',
field=models.CharField(max_length=255, choices=[('1 week', '1 Week'), ('2 weeks', '2 Weeks'), ('1 month', '1 Month'), ('1 day', '1 Day')]),
),
]