Can't delete acq.fund_debit linked to acq.invoice_item
Bug #2009066 reported by
Jason Stephenson
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Evergreen |
New
|
Undecided
|
Unassigned | ||
3.10 |
New
|
Undecided
|
Unassigned | ||
3.11 |
New
|
Undecided
|
Unassigned | ||
3.9 |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
Evergreen version 3.7.3 and 3.10.0
OpenSRF version: N/A
PostgreSQL version: 10.23, 15.2
The foreign key relationship between acq.fund_debit and acq.invoice_item prevents the deletion of acq.fund_debit rows if they are used by acq.invoice_item rows. The constraint is:
TABLE "acq.invoice_item" CONSTRAINT "invoice_
Based on the constraints with acq.fund_debit and acq.invoice_entry or acq.po_item, the above constraint ought to either be deferrable (so it will fire at the end of a transaction) or include "on delete set null."
My preference is for the latter to match the acq.invoice_entry constraint.
summary: |
- Can't delete acq.fund-debit linked to acq.invoice_item + Can't delete acq.fund_debit linked to acq.invoice_item |
tags: | added: acq |
Changed in evergreen: | |
assignee: | nobody → Jason Stephenson (jstephenson) |
tags: | added: pullrequest |
Changed in evergreen: | |
milestone: | 3.11-beta → 3.10.2 |
no longer affects: | evergreen/3.10 |
Changed in evergreen: | |
milestone: | 3.10.2 → 3.10.3 |
Changed in evergreen: | |
milestone: | 3.10.3 → 3.12-beta |
To post a comment you must log in.
Upon having a more than cursory look, the situation is not as simple as it first appeared. Some code diving is required to figure out whether making the invoice_ item_fund_ debit_fkey deferred or using on delete set null is the better option. It seems to me that po_item_ fund_debit_ fkey ought to be the same whichever choice is made.