Bug 28972

Summary: Add missing foreign key constraints to holds queue table
Product: Koha Reporter: Kyle M Hall <kyle>
Component: Hold requestsAssignee: Kyle M Hall <kyle>
Status: RESOLVED FIXED QA Contact: Joonas Kylmälä <joonas.kylmala>
Severity: minor    
Priority: P5 - low CC: gmcharlt, jonathan.druart+koha, joonas.kylmala
Version: master   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28966
Change sponsored?: --- Patch complexity: ---
Text to go in the release notes:
Version(s) released in:
21.11.00
Bug Depends on:    
Bug Blocks: 5334    
Attachments: Bug 28972: Add missing foreign key constraints to holds queue table
Bug 28972: Add missing foreign key constraints to holds queue table
Bug 28972: Add missing foreign key constraints to holds queue table
Bug 28972: Make DB rev idempotent
Bug 28972: Fix failing tests

Description Kyle M Hall 2021-09-08 12:00:30 UTC
The table tmp_holdsqueue is missing a couple key constraints that should be there.
Comment 1 Kyle M Hall 2021-09-08 12:06:31 UTC
Created attachment 124651 [details] [review]
Bug 28972: Add missing foreign key constraints to holds queue table

The table tmp_holdsqueue is missing a couple key constraints that should
be there, one for biblio and one for borrowers.

Test Plan:
1) "SHOW CREATE TABLE tmp_holdsqueue;" should show no FKs for biblio or borrowers
2) Apply this patch
3) Run updatedatabase.pl
4) "SHOW CREATE TABLE tmp_holdsqueue;" should now show FKs for biblio or borrowers
Comment 2 David Nind 2021-09-08 19:24:14 UTC
Created attachment 124662 [details] [review]
Bug 28972: Add missing foreign key constraints to holds queue table

The table tmp_holdsqueue is missing a couple key constraints that should
be there, one for biblio and one for borrowers.

Test Plan:
1) "SHOW CREATE TABLE tmp_holdsqueue;" should show no FKs for biblio or borrowers
2) Apply this patch
3) Run updatedatabase.pl
4) "SHOW CREATE TABLE tmp_holdsqueue;" should now show FKs for biblio or borrowers

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 Joonas Kylmälä 2021-09-18 10:35:44 UTC
Created attachment 125025 [details] [review]
Bug 28972: Add missing foreign key constraints to holds queue table

The table tmp_holdsqueue is missing a couple key constraints that should
be there, one for biblio and one for borrowers.

Test Plan:
1) "SHOW CREATE TABLE tmp_holdsqueue;" should show no FKs for biblio or borrowers
2) Apply this patch
3) Run updatedatabase.pl
4) "SHOW CREATE TABLE tmp_holdsqueue;" should now show FKs for biblio or borrowers

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Comment 4 Jonathan Druart 2021-09-20 11:57:28 UTC
Created attachment 125055 [details] [review]
Bug 28972: Make DB rev idempotent
Comment 5 Jonathan Druart 2021-09-20 12:48:11 UTC
Pushed to master for 21.11, thanks to everybody involved!
Comment 6 Jonathan Druart 2021-09-20 13:38:05 UTC
Tests from t/db_dependent/HoldsQueue.t and t/db_dependent/Koha/Item.t are failing. Please fix ASAP.
Comment 7 Jonathan Druart 2021-09-20 14:12:20 UTC
Created attachment 125065 [details] [review]
Bug 28972: Fix failing tests