When deletig a staff patron his/her reports are still linked to his/her former borrowernumber. It would be better to delete the connection to the creator when the staff patron is deleted.
FWIW I would kind of like to know who created a report even if they are removed from the system. Maybe link it to the deletedborrowers table and display in red or with a note? Some people's reports you might want to save, and some delete, harder to suss out if all set to null.
The idea behind this is that we shoudln't keep information about people (staff or patrons) forever in the database. When you have left the library, there should be a point where they are no longer saving things about you in their computer systems.
Agreed. My thinking was factoring in bug 13667. Once deletedborrowers is cleared, borrowernumber seems a fairly anonymous piece of info, but that might just be how we use it as staff here. As far as I can tell, the statistics table doesn't null out borrowernumber when deleting a patron either. Not a big deal and okay with this solution, just giving my 2 cents
Hi Nick, I understand your point - we are a bit crazy here about saving/deleting things :)
Created attachment 46592 [details] [review] Bug 13668: Add foreign key on saved_sql.borrowernumber saved_sql.borrowernumber refers to a borrowernumber, the DB structure should reflect this constraint. Test plan: 0/ Do not execute the update DB entry 1/ Add a new patron 2/ Use this patron to create a new report 3/ Delete the patron 4/ Execute the DB entry 5/ The saved_sql.borrowernumber for this report should have been set to NULL 6/ On the reports table, the column 'Author' should be empty.
Created attachment 46622 [details] [review] Bug 13668: Add foreign key on saved_sql.borrowernumber saved_sql.borrowernumber refers to a borrowernumber, the DB structure should reflect this constraint. Test plan: 0/ Do not execute the update DB entry 1/ Add a new patron 2/ Use this patron to create a new report 3/ Delete the patron 4/ Execute the DB entry 5/ The saved_sql.borrowernumber for this report should have been set to NULL 6/ On the reports table, the column 'Author' should be empty. Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
Created attachment 46623 [details] [review] Bug 13668: Add foreign key on saved_sql.borrowernumber saved_sql.borrowernumber refers to a borrowernumber, the DB structure should reflect this constraint. Test plan: 0/ Do not execute the update DB entry 1/ Add a new patron 2/ Use this patron to create a new report 3/ Delete the patron 4/ Execute the DB entry 5/ The saved_sql.borrowernumber for this report should have been set to NULL 6/ On the reports table, the column 'Author' should be empty. Signed-off-by: Joy Nelson <joy@bywatersolutions.com> Signed-off-by: Dani Elder <danielle@bywatersolutions.com>
Need to think about it (merge deletedborrowers with borrowers table).