  
  @python_2_unicode_compatible
  class Celebrity(models.Model):
      name = models.CharField("Name", max_length=20)
      greatest_fan = models.ForeignKey("Fan", null=True, unique=True)
  
      def __str__(self):
          return self.name
  
  
 
</s> remove     boss = models.ForeignKey('self', null=True,
                             related_name='serfs')
 </s> add     boss = models.ForeignKey('self', models.SET_NULL, null=True, related_name='serfs') </s> remove     first_book = models.ForeignKey('Book', related_name='first_time_authors+')
 </s> add     first_book = models.ForeignKey('Book', models.CASCADE, related_name='first_time_authors+') </s> remove     first_book = models.ForeignKey('Book', related_name='first_time_authors')
 </s> add     first_book = models.ForeignKey('Book', models.CASCADE, related_name='first_time_authors') </s> remove     restaurant = models.ForeignKey(Restaurant)
 </s> add     restaurant = models.ForeignKey(Restaurant, models.CASCADE) </s> remove     one = models.ForeignKey(CyclicOne)
 </s> add     one = models.ForeignKey(CyclicOne, models.CASCADE)
    greatest_fan = models.ForeignKey("Fan", models.SET_NULL, null=True, unique=True)
  
  @python_2_unicode_compatible
  class Celebrity(models.Model):
      name = models.CharField("Name", max_length=20)
    greatest_fan = models.ForeignKey("Fan", models.SET_NULL, null=True, unique=True)
  
      def __str__(self):
          return self.name
  
  
keep keep keep keep replace keep keep keep keep keep
 Fixed #21127 -- Started deprecation toward requiring on_delete for ForeignKey/OneToOneField 
tests/queries/models.py