【发布时间】:2020-02-06 21:02:33
【问题描述】:
下图来自我的数据库 Database schema
我有以下代表该架构的模型:
class Finalproduct (models.Model):
idfinalproduct = models.AutoField(primary_key=True)
idproduct = models.ForeignKey('Product',on_delete=models.CASCADE)
idtaste= models.ForeignKey('Taste', on_delete=models.CASCADE)
idpresentation = models.ForeignKey('Presentation', on_delete=models.CASCADE)
idcategory = models.ForeignKey('Category', on_delete=models.CASCADE)
cantidad = models.IntegerField()
class Meta:
unique_together = (("idproduct","idtaste","idpresentation","idcategory"),)
cantidad 字段未添加到我的数据库表 finalproduct 中。下面是MySql中迁移的结果: Mysql, table generated with model shown above
我尝试删除我的数据库、迁移,但问题从未解决。
【问题讨论】:
标签: django django-models django-rest-framework django-migrations django-mysql