字段上的null = True的完整性错误

时间:2017-07-26 14:12:38

标签: django postgresql

修改:已解决 - 问题不在于我的主模型,而是在更改为serviceImpl时创建的另一个模型。 Django工作!

这让我很难过。 我创建了一个模型,其中字段可以为Lead,但我的数据库会抛出IntegrityError。它可以在我的开发机器上运行...

这是缩写的追溯:

null=True

以下是模型:

IntegrityError: null value in column "score_updated_on" violates not-null constraint

我已经完成了所有迁移。我进入psql并运行class Lead(models.Model): created_on = models.DateTimeField(auto_now_add=True) modified_on = models.DateTimeField(auto_now=True) ... score = models.DecimalField(decimal_places=3, max_digits=7, blank=True, null=True) score_updated_on = models.DateTimeField(blank=True, null=True) active = models.BooleanField(default=True) 。没有变化。

全部解开并重新初始化数据库?这是工作的日子,但除非我能接受空值,否则这个过程不能继续。

0 个答案:

没有答案
相关问题