[db/models] Remove duplicate unique-prx constraint on pull_requests#3717
Closed
devs6186 wants to merge 1 commit intoaugurlabs:mainfrom
Closed
[db/models] Remove duplicate unique-prx constraint on pull_requests#3717devs6186 wants to merge 1 commit intoaugurlabs:mainfrom
devs6186 wants to merge 1 commit intoaugurlabs:mainfrom
Conversation
Fixes augurlabs#3192 - The pull_requests table declared two identical UniqueConstraint entries on (repo_id, pr_src_id): "unique-pr" and "unique-prx" - ON CONFLICT (pr_url) in bulk_insert_dicts only catches conflicts on "pull-request-insert-unique"; conflicts on "unique-prx" bypass the upsert handler and surface as uncaught IntegrityErrors - Drop the redundant "unique-prx" declaration from the model - A companion Alembic migration is needed to DROP CONSTRAINT "unique-prx" on existing databases Signed-off-by: devs6186 <devyanshsomvanshi@gmail.com>
Collaborator
|
This has already been addressed by #3713, which is essentially already ready to merge. Closing as duplicate |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changeset
Notes
The pull_requests table had two identical constraints: unique-pr and unique-prx, both on (repo_id, pr_src_id). The insert in bulk_insert_dicts uses ON CONFLICT (pr_url) which targets pull-request-insert-unique. When a PR conflicts on unique-prx instead, the ON CONFLICT clause does not catch it, resulting in an unhandled IntegrityError. Removing the duplicate declaration stops new installs from creating it. A companion migration to DROP CONSTRAINT "unique-prx" on existing databases should follow.
Related issues/PRs
Description
This PR fixes #3712
Notes for Reviewers
The model change alone is not enough for existing deployments — a DROP CONSTRAINT migration will be needed. Noting this for the follow-up.
Signed commits