[Bug 36101] New: Deleting an item removes the itemnumber from old_reserves when it should not
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36101 Bug ID: 36101 Summary: Deleting an item removes the itemnumber from old_reserves when it should not Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Database Assignee: koha-bugs@lists.koha-community.org Reporter: lmstrand@gmail.com QA Contact: testopia@bugs.koha-community.org Unless there's a good reason for this data loss, the itemnumber should be preserved in old_reserves after deleting an item. To reproduce: 1.1 Create an item level hold or a hold on a biblio with just one item for it 1.2 Cancel the hold 1.3 Check old_reserves, the itemnumber for the reserve is present 1.4 Delete the item linked to the reserve 1.5 Check old_reserves again, the itemnumber is now NULL or: 2.1 Create a hold for a biblio with multiple items 2.2 checkin one of the items linked to the biblio the reserve was made for and confirm the hold 2.3 Cancel the hold 2.3 Check old_reserves, the itemnumber for the reserve is present 2.4 Delete the item linked to the reserve 2.5 Check old_reserves again, the itemnumber is now NULL The constraint that does the deletion from old_reserves-table when an item is deleted: CONSTRAINT `old_reserves_ibfk_3` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE SET NULL ON UPDATE SET NULL This should be removed. After removal the itemnumber does not get deleted from the old_Reserves table when the item is deleted. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36101 Andrew Fuerste-Henry <andrewfh@dubcolib.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |andrewfh@dubcolib.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36101 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |emmi.takkinen@koha-suomi.fi -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36101 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=25260 CC| |jonathan.druart@gmail.com -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36101 Lari Strand <lmstrand@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36101 --- Comment #1 from Lari Strand <lmstrand@gmail.com> --- Created attachment 163087 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=163087&action=edit Bug 36101: Drop constraint to items.itemnumber from old_reserves-table This patch removes the constraint from old_reserves table to the items table so a deleted item's itemnumber will be preserved in the old_reserves table. To test: 1. Apply patch 2. run updatedatabase.pl 3. Check constraint old_reserves_ibfk_3 has been dropped -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36101 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |normal -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36101 Katie Bliss <kebliss@dmpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kebliss@dmpl.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36101 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36101 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #163087|0 |1 is obsolete| | --- Comment #2 from Lucas Gass <lucas@bywatersolutions.com> --- Created attachment 163119 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=163119&action=edit Bug 36101: Drop constraint to items.itemnumber from old_reserves-table Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36101 --- Comment #3 from Lucas Gass <lucas@bywatersolutions.com> --- Created attachment 163120 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=163120&action=edit Bug 36101: (follow-up) Fix DBUpdate file permission and perltidy Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36101 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com --- Comment #4 from Lucas Gass <lucas@bywatersolutions.com> --- Looks good, I added a follow to fix the file permission for installer/data/mysql/atomicupdate/bug_36101.pl and perltidy. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36101 --- Comment #5 from Lari Strand <lmstrand@gmail.com> --- Thank you Lucas. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36101 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl Assignee|koha-bugs@lists.koha-commun |lmstrand@gmail.com |ity.org | --- Comment #6 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Filling assignee. Please do it yourself next time. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36101 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #7 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Lari Strand from comment #0)
Unless there's a good reason for this data loss, the itemnumber should be preserved in old_reserves after deleting an item.
Please explain why there is a good reason to do so. Keeping an itemnumber in this table that does no longer exist is bad practice. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36101 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |m.de.rooy@rijksmuseum.nl |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36101 --- Comment #8 from Jonathan Druart <jonathan.druart@gmail.com> --- Also we have CONSTRAINT `old_issues_ibfk_2` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE SET NULL ON UPDATE SET NULL, -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36101 --- Comment #9 from Lari Strand <lmstrand@gmail.com> --- In our case, we need to find out the biblio details for the deleted item so we can show these details for patrons in their lists of past loans/old issues. Without the itemnumber in the old_issues table finding out what the patron has previously loaned is impossible. We are not using opac as a patron interface, we have our own implementation, that uses this plugin to talk to the web interface: https://github.com/KohaSuomi/koha-plugin-rest-di If the biblio is also deleted, we can find the details from deletedbiblio-table. Maybe finding out biblio details based on the old_issues itemnumber might be interesting for statistical/reporting purposes as well. "Keeping an itemnumber in this table that does no longer exist is bad practice." We still have deleted-tables so I don't consider the data as non-existing. If we touch these old_-tables like this and destroy this archived data that can be linked still with deleted-tables, shouldn't we do the same to action_logs? I consider action_logs as an "archive" table just like old_issues or old_reserves (not sure if we do this already, though. Remove itemnumbers/biblionumbers from action_logs that are linked to deleted items/biblios?). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36101 --- Comment #10 from Lari Strand <lmstrand@gmail.com> --- Sorry, I was supposed to comment this to https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32729, but the same logic applies here I assume. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36101 --- Comment #11 from Lari Strand <lmstrand@gmail.com> --- This ticket is just to make handling of these two old_ -tables' itemnumber data uniform. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36101 --- Comment #12 from Lari Strand <lmstrand@gmail.com> --- We should also consider the impact this change makes when we join deleted-tables with "active" tables in the future, when nothing is really deleted and transferred to somewhere else, but tagged as "deleted" in an always "active" table. Will deleting the data still make sense in the future? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36101 --- Comment #13 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Lari Strand from comment #9)
"Keeping an itemnumber in this table that does no longer exist is bad practice."
We still have deleted-tables so I don't consider the data as non-existing.
Dont you think that we should adhere to proven standards as to SQL, normalization, etc ? :)
If we touch these old_-tables like this and destroy this archived data that can be linked still with deleted-tables, shouldn't we do the same to action_logs? I consider action_logs as an "archive" table just like old_issues or old_reserves (not sure if we do this already, though. Remove itemnumbers/biblionumbers from action_logs that are linked to deleted items/biblios?).
Good point. There is room for further improvement indeed. But no reason to switch good to less. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36101 Andrew Fuerste-Henry <andrewfh@dubcolib.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |In Discussion --- Comment #14 from Andrew Fuerste-Henry <andrewfh@dubcolib.org> --- (In reply to Marcel de Rooy from comment #7)
(In reply to Lari Strand from comment #0)
Unless there's a good reason for this data loss, the itemnumber should be preserved in old_reserves after deleting an item.
Please explain why there is a good reason to do so. Keeping an itemnumber in this table that does no longer exist is bad practice.
The itemnumber in the reserves table may refer to an item in the items table or may refer to an item in the deleteditems table. The [table]/deleted[table] structure for items and bibs supports the fundamental idea that a library may need to know about titles/items that were once in their collection but are not any longer. Even after an item has been removed from the collection, it's still useful to know which holds and checkouts involved that item. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36101 Andrew Fuerste-Henry <andrewfh@dubcolib.org> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=32729 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36101 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nick@bywatersolutions.com See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=33262 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36101 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=36345 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36101 paxed <pasi.kallinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |pasi.kallinen@koha-suomi.fi --- Comment #15 from paxed <pasi.kallinen@koha-suomi.fi> --- (In reply to Marcel de Rooy from comment #7)
(In reply to Lari Strand from comment #0)
Unless there's a good reason for this data loss, the itemnumber should be preserved in old_reserves after deleting an item.
Please explain why there is a good reason to do so. Keeping an itemnumber in this table that does no longer exist is bad practice.
The items may not exist physically in the library, but the data certainly does in the deleteditems/deletdbiblio/whatever tables. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36101 --- Comment #16 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Hi, I agree with not removing the information about the linked item even if it was deleted, for the reasons given. But maybe we can find some middle ground here with the implementation. Have you seen the discussion on bug 36345? It suggests the fix we have recently implemented for the biblionumber in aqorders. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36101 --- Comment #17 from Lari Strand <lmstrand@gmail.com> ---
Dont you think that we should adhere to proven standards as to SQL, normalization, etc ? :)
I think we should adhere to the needs of the users who use the library system. We only gain more functionality in the system by not touching the data (use cases reported in both tickets concerning old_-tables versus following "good practice" for no gains or benefits whatsoever (are there really standards for this to follow? What is the good practice concerning archived data?). Anyways, feels more like bad practice in my mind to touch these tables when deleting stuff. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=36101 --- Comment #18 from Lucas Gass <lucas@bywatersolutions.com> ---
Dont you think that we should adhere to proven standards as to SQL, normalization, etc ? :)
We should keep the data that librarians want to keep. If the problem is a FK constraint then that FK constraint should go, not the data librarians need. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org