  
  class House(models.Model):
      name = models.CharField(max_length=50)
      address = models.CharField(max_length=255)
      owner = models.ForeignKey('Person', null=True)
      main_room = models.OneToOneField('Room', related_name='main_room_of', null=True)
  
      class Meta:
          ordering = ['id']
  
  
 
</s> remove     author = models.ForeignKey(Author, to_field='name', related_name='addresses')
 </s> add     author = models.ForeignKey(Author, models.CASCADE, to_field='name', related_name='addresses') </s> remove     b = models.ForeignKey(B, null=True)
 </s> add     b = models.ForeignKey(B, models.SET_NULL, null=True) </s> remove     house = models.ForeignKey(House, related_name='rooms')
 </s> add     house = models.ForeignKey(House, models.CASCADE, related_name='rooms') </s> remove     reporter = models.ForeignKey(Reporter, null=True)
 </s> add     reporter = models.ForeignKey(Reporter, models.SET_NULL, null=True) </s> remove     alfa = models.ForeignKey(Alfa, null=True)
    bravo = models.ForeignKey(Bravo, null=True)
 </s> add     alfa = models.ForeignKey(Alfa, models.SET_NULL, null=True)
    bravo = models.ForeignKey(Bravo, models.SET_NULL, null=True)
    owner = models.ForeignKey('Person', models.SET_NULL, null=True)
    main_room = models.OneToOneField('Room', models.SET_NULL, related_name='main_room_of', null=True)
  
  class House(models.Model):
      name = models.CharField(max_length=50)
      address = models.CharField(max_length=255)
    owner = models.ForeignKey('Person', models.SET_NULL, null=True)
    main_room = models.OneToOneField('Room', models.SET_NULL, related_name='main_room_of', null=True)
    owner = models.ForeignKey('Person', models.SET_NULL, null=True)
    main_room = models.OneToOneField('Room', models.SET_NULL, related_name='main_room_of', null=True)
  
      class Meta:
          ordering = ['id']
  
  
keep keep keep keep replace replace keep keep keep keep keep
 Fixed #21127 -- Started deprecation toward requiring on_delete for ForeignKey/OneToOneField 
tests/prefetch_related/models.py