  @python_2_unicode_compatible
  class Fan(models.Model):
      name = models.CharField(max_length=50)
      age = models.PositiveSmallIntegerField(default=30)
      author = models.ForeignKey(Author, related_name='fans')
  
      def __str__(self):
          return self.name
 
</s> remove     author = models.ForeignKey(Author, to_field='name', related_name='i_like')
    likes_author = models.ForeignKey(Author, to_field='name', related_name='likes_me')
 </s> add     author = models.ForeignKey(Author, models.CASCADE, to_field='name', related_name='i_like')
    likes_author = models.ForeignKey(Author, models.CASCADE, to_field='name', related_name='likes_me') </s> remove     author = models.OneToOneField(Author, parent_link=True)
 </s> add     author = models.OneToOneField(Author, models.CASCADE, parent_link=True) </s> remove     author = models.ForeignKey(Author)
 </s> add     author = models.ForeignKey(Author, models.CASCADE) </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)
    author = models.ForeignKey(Author, models.CASCADE, related_name='fans')
  @python_2_unicode_compatible
  class Fan(models.Model):
      name = models.CharField(max_length=50)
      age = models.PositiveSmallIntegerField(default=30)
    author = models.ForeignKey(Author, models.CASCADE, related_name='fans')
  
      def __str__(self):
          return self.name
keep keep keep keep replace keep keep keep
 Fixed #21127 -- Started deprecation toward requiring on_delete for ForeignKey/OneToOneField 
tests/db_functions/models.py