Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete before insert inside same version #228

Merged
merged 2 commits into from
May 2, 2024
Merged

Conversation

ValtsS
Copy link
Contributor

@ValtsS ValtsS commented May 2, 2024

Ran into issue when application sets up transaction that deletes and inserts a new row (with a new identity id). If this is applied in incorrect order and there is an index which has a unique constraint this will cause insert to fail because the previous row has not been deleted yet.

This solves the issue by running following order delete->insert->update.

Here is an example of the table with composite PK with identity:

image

Copy link

codecov bot commented May 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.98%. Comparing base (5e47361) to head (fa0ab4e).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #228   +/-   ##
=======================================
  Coverage   87.98%   87.98%           
=======================================
  Files           8        8           
  Lines         491      491           
  Branches       68       68           
=======================================
  Hits          432      432           
  Misses         48       48           
  Partials       11       11           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mganss mganss merged commit 2c07dc8 into mganss:master May 2, 2024
3 checks passed
@mganss
Copy link
Owner

mganss commented May 2, 2024

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants