  
  @python_2_unicode_compatible
  class Leaf(models.Model):
      name = models.CharField(max_length=10)
      child = models.ForeignKey(Child)
      second_child = models.ForeignKey(Child, related_name="other", null=True)
      value = models.IntegerField(default=42)
  
      def __str__(self):
          return self.name
  
 
</s> remove     creator = models.ForeignKey(Author, to_field='num', null=True)
 </s> add     creator = models.ForeignKey(Author, models.SET_NULL, to_field='num', null=True) </s> remove     related = models.ForeignKey(Secondary)
 </s> add     related = models.ForeignKey(Secondary, models.CASCADE) </s> remove     tag = models.ForeignKey(Tag)
 </s> add     tag = models.ForeignKey(Tag, models.CASCADE) </s> remove     team = models.ForeignKey(Team, null=True)
 </s> add     team = models.ForeignKey(Team, models.SET_NULL, null=True) </s> remove     extra = models.ForeignKey(ExtraInfo)
 </s> add     extra = models.ForeignKey(ExtraInfo, models.CASCADE)
    child = models.ForeignKey(Child, models.CASCADE)
    second_child = models.ForeignKey(Child, models.SET_NULL, related_name="other", null=True)
  
  @python_2_unicode_compatible
  class Leaf(models.Model):
      name = models.CharField(max_length=10)
    child = models.ForeignKey(Child, models.CASCADE)
    second_child = models.ForeignKey(Child, models.SET_NULL, related_name="other", null=True)
    child = models.ForeignKey(Child, models.CASCADE)
    second_child = models.ForeignKey(Child, models.SET_NULL, related_name="other", null=True)
      value = models.IntegerField(default=42)
  
      def __str__(self):
          return self.name
  
keep keep keep keep replace replace keep keep keep keep keep
 Fixed #21127 -- Started deprecation toward requiring on_delete for ForeignKey/OneToOneField 
tests/defer_regress/models.py