[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
Thu Jul 27 14:17:32 CEST 2023
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30451
Jonathan Druart <jonathan.druart+koha at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #153818|0 |1
is obsolete| |
--- Comment #8 from Jonathan Druart <jonathan.druart+koha at gmail.com> ---
Created attachment 153966
-->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=153966&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>
JD amended patch: perl tidy
Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>
--
You are receiving this mail because:
You are watching all bug changes.
More information about the Koha-bugs
mailing list