      objects = MemberManager()
  
  
  class Child(models.Model):
      person = models.OneToOneField(Member, primary_key=True)
      parent = models.ForeignKey(Member, related_name="children")
  
  # Custom primary keys interfered with ordering in the past.
  
  
  class CustomPk(models.Model):
 
</s> remove     details = models.OneToOneField(Detail, primary_key=True)
 </s> add     details = models.OneToOneField(Detail, models.CASCADE, primary_key=True) </s> remove     person = models.ForeignKey(Person, primary_key=True)
 </s> add     person = models.ForeignKey(Person, models.CASCADE, primary_key=True) </s> remove             parent = models.ForeignKey(Parent)
 </s> add             parent = models.ForeignKey(Parent, models.CASCADE) </s> remove         person = models.ForeignKey(Person)
        group = models.ForeignKey(Group)
 </s> add         person = models.ForeignKey(Person, on_delete=models.CASCADE)
        group = models.ForeignKey(Group, on_delete=models.CASCADE) </s> remove     person = models.OneToOneField(Person, primary_key=True)
 </s> add     person = models.OneToOneField(Person, models.CASCADE, primary_key=True)
    person = models.OneToOneField(Member, models.CASCADE, primary_key=True)
    parent = models.ForeignKey(Member, models.CASCADE, related_name="children")
      objects = MemberManager()
  
  
  class Child(models.Model):
    person = models.OneToOneField(Member, models.CASCADE, primary_key=True)
    parent = models.ForeignKey(Member, models.CASCADE, related_name="children")
    person = models.OneToOneField(Member, models.CASCADE, primary_key=True)
    parent = models.ForeignKey(Member, models.CASCADE, related_name="children")
  
  # Custom primary keys interfered with ordering in the past.
  
  
  class CustomPk(models.Model):
keep keep keep keep replace replace keep keep keep keep keep
 Fixed #21127 -- Started deprecation toward requiring on_delete for ForeignKey/OneToOneField 
tests/queries/models.py