Bug 26995

Summary: Drop column relationship from borrower tables
Product: Koha Reporter: David Cook <dcook>
Component: PatronsAssignee: Kyle M Hall <kyle>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: minor    
Priority: P5 - low CC: fridolin.somers, gmcharlt, jonathan.druart, kyle.m.hall, kyle, m.de.rooy, martin.renvoize, nugged
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Medium patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
21.05.00
Bug Depends on: 14570    
Bug Blocks: 28490    
Attachments: Bug 26995: Drop columns from database
Bug 26995: Remove references to relationship column
Bug 26995: Update schema [DO NOT PUSH]
Bug 26995: Drop column relationship from borrowers, deletedborrowers and borrower_modifications tables
Bug 26995: Remove references to relationship column
Bug 26995: Update schema [DO NOT PUSH]
Bug 26995: Drop column relationship from borrowers, deletedborrowers and borrower_modifications tables
Bug 26995: Remove references to relationship column
Bug 26995: Drop column relationship from borrowers, deletedborrowers and borrower_modifications tables
Bug 26995: Remove references to relationship column
Bug 26995: (QA follow-up) Fix logic in database update
Bug 26995: Drop column relationship from borrowers, deletedborrowers and borrower_modifications tables
Bug 26995: Remove references to relationship column
Bug 26995: (QA follow-up) Fix logic in database update
Bug 26995: Fix SQL syntax error on the about page
Bug 26995: Remove occurrences in sample_patrons.yml
Bug 26995: Remove one remaining occurrence in moremember

Description David Cook 2020-11-11 01:01:32 UTC
Bug 14570 added a borrower_relationships table but it didn't remove the relationship column from the following tables:

- deletedborrowers
- borrowers
- borrower_modifications

It will need to be removed from many of the same places as "guarantorid" from Bug 14570 like:

- C4/Auth_with_ldap
- C4/SIP/ILS/Patron.pm
- Possibly other places...
Comment 1 Kyle M Hall 2021-01-21 12:14:22 UTC
Created attachment 115532 [details] [review]
Bug 26995: Drop columns from database
Comment 2 Kyle M Hall 2021-01-21 12:14:31 UTC Comment hidden (obsolete)
Comment 3 Kyle M Hall 2021-01-21 12:14:35 UTC Comment hidden (obsolete)
Comment 4 Kyle M Hall 2021-01-21 12:24:34 UTC
Created attachment 115537 [details] [review]
Bug 26995: Drop column relationship from borrowers, deletedborrowers and borrower_modifications tables

Bug 14570 added a borrower_relationships table but it didn't remove the relationship column from the following tables:
- deletedborrowers
- borrowers
- borrower_modifications
Comment 5 Kyle M Hall 2021-01-21 12:24:45 UTC
Created attachment 115538 [details] [review]
Bug 26995: Remove references to relationship column
Comment 6 Kyle M Hall 2021-01-21 12:24:49 UTC
Created attachment 115539 [details] [review]
Bug 26995: Update schema [DO NOT PUSH]
Comment 7 Kyle M Hall 2021-01-21 12:26:21 UTC
Not sure how to write a test plan for this.
Comment 8 Jonathan Druart 2021-05-03 10:08:12 UTC
Created attachment 120399 [details] [review]
Bug 26995: Drop column relationship from borrowers, deletedborrowers and borrower_modifications tables

Bug 14570 added a borrower_relationships table but it didn't remove the relationship column from the following tables:
- deletedborrowers
- borrowers
- borrower_modifications
Comment 9 Jonathan Druart 2021-05-03 10:08:16 UTC
Created attachment 120400 [details] [review]
Bug 26995: Remove references to relationship column
Comment 10 Martin Renvoize 2021-05-04 12:49:43 UTC
Created attachment 120451 [details] [review]
Bug 26995: Drop column relationship from borrowers, deletedborrowers and borrower_modifications tables

Bug 14570 added a borrower_relationships table but it didn't remove the relationship column from the following tables:
- deletedborrowers
- borrowers
- borrower_modifications

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 11 Martin Renvoize 2021-05-04 12:49:47 UTC
Created attachment 120452 [details] [review]
Bug 26995: Remove references to relationship column

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 12 Martin Renvoize 2021-05-04 12:49:51 UTC
Created attachment 120453 [details] [review]
Bug 26995: (QA follow-up) Fix logic in database update

The logic was reversed.. if the column exists we want to delete it ;)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 13 Martin Renvoize 2021-05-04 12:51:07 UTC
Not sure what happened with this one.. there are patches uploaded by Jonathan but no signoff lines from him and the author suggests Kyle.


Either way, it works as expected with my follow-up.

Signing off.
Comment 14 Jonathan Druart 2021-05-04 13:26:45 UTC
(In reply to Martin Renvoize from comment #13)
> Not sure what happened with this one.. there are patches uploaded by
> Jonathan but no signoff lines from him and the author suggests Kyle.

I've only rebased the patch yesterday.
Comment 15 Katrin Fischer 2021-05-09 13:42:01 UTC
Created attachment 120744 [details] [review]
Bug 26995: Drop column relationship from borrowers, deletedborrowers and borrower_modifications tables

Bug 14570 added a borrower_relationships table but it didn't remove the relationship column from the following tables:
- deletedborrowers
- borrowers
- borrower_modifications

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 16 Katrin Fischer 2021-05-09 13:42:06 UTC
Created attachment 120745 [details] [review]
Bug 26995: Remove references to relationship column

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 17 Katrin Fischer 2021-05-09 13:42:11 UTC
Created attachment 120746 [details] [review]
Bug 26995: (QA follow-up) Fix logic in database update

The logic was reversed.. if the column exists we want to delete it ;)

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 18 Jonathan Druart 2021-05-10 12:28:20 UTC
Created attachment 120775 [details] [review]
Bug 26995: Fix SQL syntax error on the about page
Comment 19 Jonathan Druart 2021-05-10 13:42:34 UTC
Created attachment 120793 [details] [review]
Bug 26995: Remove occurrences in sample_patrons.yml
Comment 20 Jonathan Druart 2021-05-10 14:17:55 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 21 Jonathan Druart 2021-05-11 08:46:38 UTC
Created attachment 120826 [details] [review]
Bug 26995: Remove one remaining occurrence in moremember
Comment 22 Jonathan Druart 2021-05-11 08:48:21 UTC
Follow-up pushed to master.
Comment 23 Fridolin Somers 2021-05-12 14:51:01 UTC
I propose we do not push to stable branches.
Comment 24 David Cook 2021-08-18 06:46:36 UTC
Uh oh, we've introduced a regression here with data loss...

It turns out we still needed the "relationship" column for "Non-patron guarantor" entries.

It means you can't save patron records that need guarantors because the form can't be processed. 

And anyone who applies 21.05 will lose the data that they had in borrowers.relationship...
Comment 25 David Cook 2021-08-18 06:47:54 UTC
(In reply to David Cook from comment #24)
> Uh oh, we've introduced a regression here with data loss...
> 
> It turns out we still needed the "relationship" column for "Non-patron
> guarantor" entries.
> 
> It means you can't save patron records that need guarantors because the form
> can't be processed. 
> 
> And anyone who applies 21.05 will lose the data that they had in
> borrowers.relationship...

Ah, just noticed bug 28490. People are already on top of this.
Comment 26 Marcel de Rooy 2022-10-13 12:03:04 UTC
    NewVersion( $DBversion, 26995, "[SKIP] Drop column relationship from borrower tables [not executed]");

Printing this made me wonder what happened ;) Print nothing, no concerns..