[Koha-bugs] [Bug 30451] Delete a subscription deletes the linked order

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Jul 21 23:57:44 CEST 2023


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30451

Biblibre Sandboxes <sandboxes at biblibre.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #153799|0                           |1
        is obsolete|                            |

--- Comment #7 from Biblibre Sandboxes <sandboxes at biblibre.com> ---
Created attachment 153818
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=153818&action=edit
Bug 30451: Update FK constraint on aqorders.subscriptionid

This updates the FK constrant from ON DELETE CASCADE to ON DELETE
SET NULL. This means that if a subscription linked to an order is
deleted, we no longer will also delete the order, but we will just
set subscrptinid in the order to NULL. This will avoid data loss
that can cause the budgets/funds not to add up anymore with the
real espenses of the library.

To test:

Preparation:
* Create 2 subscriptions on different records
* Create a new basket
* Use the "order from subscription" functionality to create order
  lines for both of your subscriptions
* Close basket

Without patch:
* Delete the first subscription
* Verify the order line for this subscription is gone from your basket

Apply patch:
* Run database update and restart_all
* Delete the second subscription
* Verify the order line now remained in the basket

Signed-off-by: Michaela Sieber <michaela.sieber at kit.edu>

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list