-
Notifications
You must be signed in to change notification settings - Fork 24
Fixes a Pulp2Content unique-constraint that wasn't very unique. #331
Conversation
5575c5d
to
b1ff65c
Compare
This is in draft for two reasons: First - Making the UQ 'correct' means we probably do NOT need to make sure errata store repo_id in subid. After discussion around this approach, we may remove the Pulp2Content(type=erratum).update() from the migration, and the code that copies repo-id into subid. Second, and more painful - with the corrected UQ in place, the reproducer from https://pulp.plan.io/issues/8329#note-3 fails with the stacktrace noted in comment-10. Discussion needed on how we address the problem. |
bulk_create(pulp2content, ignore_conflicts=True) causes more trouble than it's worth :( |
b1ff65c
to
5ee1bc2
Compare
In Postgres, all NULLs are unique - so if a nullable field is included in a UiniqueConstraint, it allows rows that differ only by the NULL. Build two constraints, one when the 'optional' field is NULL, and one where it has content. fixes #8329 [nocoverage]
5ee1bc2
to
fbcd441
Compare
Both of these issues should now be resolved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
In Postgres, all NULLs are unique - so if a nullable field is included
in a UiniqueConstraint, it allows rows that differ only by the NULL.
Build two constraints, one when the 'optional' field is NULL, and
one where it has content.
fixes #8329
[nocoverage]