如何从ForeignKey迁移到ManyToMany?
原型
class Campaign(TimeStampedModel):
featured_review = models.ForeignKey(
'reviews.Review',
blank=True,
null=True,
related_name='featured_on',
default=None
)
修改后的模型
class Campaign(TimeStampedModel):
featured_review = models.ManyToManyField(
'reviews.Review',
blank=True,
null=True,
related_name='featured_on',
default=None
)
当我跑步时
./manage.py schemamigration companies --auto
我有“似乎没有任何改变。”