[Koha-bugs] [Bug 21901] Foreign keys are missing on the serials and subscriptions tables

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Apr 17 10:17:36 CEST 2020


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

Marcel de Rooy <m.de.rooy at rijksmuseum.nl> changed:

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

--- Comment #27 from Marcel de Rooy <m.de.rooy at rijksmuseum.nl> ---
Created attachment 103122
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=103122&action=edit
Bug 21901: Add FK on subscription and serial tables

In order to improve performance in the serial modules and add DB constraints,
this patch is going to add missing foreign key on the following columns:
 * serial.biblionumber
 * serial.subscription
 * subscriptionhistory.biblionumber
 * subscriptionhistory.subscriptionid
 * subscription.biblionumber

Once done, some code can be removed from the Del* subroutines, as the ON
CASCASE clause will make the RDBMS handles the deletions.

Test plan:
0/ It would be useful to test the update DB entry on a big and old
production DB, to make sure the constraints will be added correctly.
We could remove the entries before creating the constraints, but it can
be unecessary
1/ Make sure you can recreate a fresh install with the kohastructure.sql
from this patch
2/ Make sure you can upgrade from a master install
3/ Create a subscription, serial, etc. and delete the biblio
=> The subscription/serials should have been deleted from the DB
4/ Create a subscription, serial, etc. and delete the subscription
=> The serials should have been deleted from the DB

Signed-off-by: Martin Renvoize <martin.renvoize at ptfs-europe.com>

Signed-off-by: Marcel de Rooy <m.de.rooy at rijksmuseum.nl>

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


More information about the Koha-bugs mailing list