Skip to content
Snippets Groups Projects

Add unique constraint on batch changes table

Created by: eseliger

Now that there are multiple entry points to creating a batch change, we figured it'd be safer to have a unique constraint in place here. There are certainly some race conditions that can cause duplicates to happen and we currently handle those very poorly.

Closes https://github.com/sourcegraph/sourcegraph/issues/29164

Test plan

We have a big test suite around all the mutations that could be affected by this, and I did some manual test runs both on the DB layer and from the app to verify this doesn't break anything. To be clear, this already had proper error handling in place, this is just guarding the application layer checks for race conditions.

Merge request reports

Approval is optional

Merged by avatar (Aug 23, 2025 11:08am UTC)

Merge details

  • Changes merged into main with 3213a4c1.
  • Deleted the source branch.

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading