OneToOneField cannot be a primary key
|Reported by:||moof@…||Owned by:||jacob|
|Has patch:||no||Needs documentation:|
|Needs tests:||Patch needs improvement:|
Similar to #3768, in the [source:django/trunk/tests/regressiontests/serializers_regress/models.py#4757 serializer regression tests] you have:
class O2OData(models.Model): data = models.OneToOneField(Anchor, null=True)
This cannot be made true for SQL server, as no NULL field can be a primary key.
More to the point, I fail to see how a field like this could ever be a primary key.
This test should be removed.