Skip to content

fix: Bounty.issue FK from CASCADE to RESTRICT - #239

Merged
chonilius merged 1 commit into
MergeFi:mainfrom
Williams-1604:fix/bounty-issue-fk-restrict-53-21-52-23
Aug 27, 2026
Merged

fix: Bounty.issue FK from CASCADE to RESTRICT#239
chonilius merged 1 commit into
MergeFi:mainfrom
Williams-1604:fix/bounty-issue-fk-restrict-53-21-52-23

Conversation

@Williams-1604

Copy link
Copy Markdown

Summary

bounties.issueId's foreign key was ON DELETE CASCADE — the only CASCADE among Bounty's relations. Every other one (sponsor, claimedBy, team) uses SET NULL, and #27's EscrowFkIntegrityAndSponsorId migration already established the convention that financial-adjacent rows (escrows, payments) must never cascade-delete — a Bounty may reference a funded Escrow, so deleting its parent Issue must not silently delete it too.

Changes

Closes #53
Closes #21
Closes #52
Closes #23

…tion convention

bounties.issueId was ON DELETE CASCADE, unlike every other
financial-adjacent relation on Bounty (sponsor/claimedBy/team use
SET NULL) and unlike the escrow/payment FKs fixed in MergeFi#27's
EscrowFkIntegrityAndSponsorId migration (SET NULL/RESTRICT).
Deleting an Issue must never silently delete its Bounty, which may
reference a funded Escrow. issueId is NOT NULL so RESTRICT (not SET
NULL) is the correct action here.

Closes MergeFi#53
Closes MergeFi#21
Closes MergeFi#52
Closes MergeFi#23
@drips-wave

drips-wave Bot commented Aug 27, 2026

Copy link
Copy Markdown

@Williams-1604 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@chonilius
chonilius merged commit 83a1e96 into MergeFi:main Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment