Fix duplicate row index on upsert statement #213

Merged
bustikiller merged 2 commits from fix-upsert-index into main 2025-01-14 22:11:43 +00:00
Owner

Why

The previous implementation does not specify which is the index that should be used during the upsert operation, sometimes leading to errors like:

backend-1  | [2bc5ac07-4bc9-4c0e-bf00-4fd9e64c2c74] ActiveRecord::RecordNotUnique (PG::UniqueViolation: ERROR:  duplicate key value violates unique constraint "uindex_group_pair"
backend-1  | DETAIL:  Key (LEAST(group_a_id, group_b_id), GREATEST(group_a_id, group_b_id))=(3f367786-5338-4839-aaf4-e3aaaa9f4a14, ec33d521-c586-4c56-b5f0-29e3d0097c8f) already exists.
backend-1  | )
## Why The previous implementation does not specify which is the index that should be used during the upsert operation, sometimes leading to errors like: ``` backend-1 | [2bc5ac07-4bc9-4c0e-bf00-4fd9e64c2c74] ActiveRecord::RecordNotUnique (PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "uindex_group_pair" backend-1 | DETAIL: Key (LEAST(group_a_id, group_b_id), GREATEST(group_a_id, group_b_id))=(3f367786-5338-4839-aaf4-e3aaaa9f4a14, ec33d521-c586-4c56-b5f0-29e3d0097c8f) already exists. backend-1 | ) ```
bustikiller added 1 commit 2025-01-14 18:15:23 +00:00
Fix duplicate row index on upsert statement
Some checks failed
Add copyright notice / copyright_notice (pull_request) Successful in 1m22s
Run unit tests / unit_tests (pull_request) Successful in 2m59s
Build Nginx-based docker image / build-static-assets (pull_request) Failing after 8m46s
Check usage of free licenses / check-licenses (pull_request) Successful in 1m49s
c6c5a87d8b
bustikiller added 1 commit 2025-01-14 21:08:38 +00:00
Merge branch 'main' into fix-upsert-index
All checks were successful
Add copyright notice / copyright_notice (pull_request) Successful in 1m51s
Check usage of free licenses / check-licenses (pull_request) Successful in 1m9s
Run unit tests / unit_tests (pull_request) Successful in 3m18s
Build Nginx-based docker image / build-static-assets (pull_request) Successful in 15m7s
889485eaab
bustikiller merged commit d6fd72a45c into main 2025-01-14 22:11:43 +00:00
Sign in to join this conversation.
No Reviewers
No Label
No Milestone
No project
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: bustikiller/wedding-planner#213
No description provided.