[Bug 32686] New: Specify action of action_logs entries to purge
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32686 Bug ID: 32686 Summary: Specify action of action_logs entries to purge Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Command-line Utilities Assignee: koha-bugs@lists.koha-community.org Reporter: alexbuckley@catalyst.net.nz QA Contact: testopia@bugs.koha-community.org CC: robin@catalyst.net.nz It would be helpful if libraries could specify the action of entries in the action_logs table to purge. Use case: Libraries with a patron import overwriting patron records several times a day will likely want to truncate member 'create' entries from the action_logs tables, whilst retaining other patron action_logs entries, like below: ./cleanup_database.pl --logs 30 --log-module=MEMBERS --log-action=CREATE --confirm -- 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=32686 --- Comment #1 from Alex Buckley <alexbuckley@catalyst.net.nz> --- *** Bug 32480 has been marked as a duplicate of this bug. *** -- 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=32686 Alex Buckley <alexbuckley@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |alexbuckley@catalyst.net.nz |ity.org | Status|NEW |ASSIGNED Change sponsored?|--- |Sponsored -- 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=32686 --- Comment #2 from Alex Buckley <alexbuckley@catalyst.net.nz> --- Created attachment 145499 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=145499&action=edit Bug 32686: Specify action of action_logs to purge Add --log-action parameter to cleanup_database.pl Test plan: 1. Apply patch 2. Enable cataloguing and borrowers log 3. Make some changes to borrowers, create some borrowers, and edit some biblio records 4. Change the action_logs.timestamp for all action_logs entries to 367 days ago 5. Run cleanup_database.pl with --logs 365 --log-module=MEMBERS --log-action=CREATE --confirm 6. Confirm only the borrowers creation action_logs entries are removed 7. Run cleanup_database.pl with --logs 365 8. Confirm all action_logs entries are removed Sponsored-By: Toi Ohomai Institute of Technology, New Zealand -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32686 Alex Buckley <alexbuckley@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32686 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32686 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #145499|0 |1 is obsolete| | --- Comment #3 from David Nind <david@davidnind.com> --- Created attachment 145781 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=145781&action=edit Bug 32686: Specify action of action_logs to purge Add --log-action parameter to cleanup_database.pl Test plan: 1. Apply patch 2. Enable cataloguing and borrowers log 3. Make some changes to borrowers, create some borrowers, and edit some biblio records 4. Change the action_logs.timestamp for all action_logs entries to 367 days ago 5. Run cleanup_database.pl with --logs 365 --log-module=MEMBERS --log-action=CREATE --confirm 6. Confirm only the borrowers creation action_logs entries are removed 7. Run cleanup_database.pl with --logs 365 8. Confirm all action_logs entries are removed Sponsored-By: Toi Ohomai Institute of Technology, New Zealand Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32686 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com --- Comment #4 from David Nind <david@davidnind.com> --- Testing notes (using koha-testing-docker): 1. Step 4 SQL query to update the timestamp: . koha-mysql kohadev . update action_logs set timestamp = "2022-01-01 01:00:00"; 2. Step 6 SQL query - ran before and after step 6 (number should reduce by the number of new patrons you created): . select * from action_logs where module = "MEMBERS"; 3. Step 8 SQL query - should be no rows: select * from action_logs; -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32686 Magnus Enger <magnus@libriotech.no> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |magnus@libriotech.no -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32686 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #145781|0 |1 is obsolete| | --- Comment #5 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Created attachment 147583 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=147583&action=edit Bug 32686: Specify action of action_logs to purge Add --log-action parameter to cleanup_database.pl Test plan: 1. Apply patch 2. Enable cataloguing and borrowers log 3. Make some changes to borrowers, create some borrowers, and edit some biblio records 4. Change the action_logs.timestamp for all action_logs entries to 367 days ago 5. Run cleanup_database.pl with --logs 365 --log-module=MEMBERS --log-action=CREATE --confirm 6. Confirm only the borrowers creation action_logs entries are removed 7. Run cleanup_database.pl with --logs 365 8. Confirm all action_logs entries are removed Sponsored-By: Toi Ohomai Institute of Technology, New Zealand Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32686 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |victor@tuxayo.net Status|Signed Off |Passed QA --- Comment #6 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Works (including multiple --log-action), QA script happy, code looks good, passing QA :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32686 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com Status|Passed QA |Patch doesn't apply -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32686 --- Comment #7 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Please rebase. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32686 Alex Buckley <alexbuckley@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #147583|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32686 --- Comment #8 from Alex Buckley <alexbuckley@catalyst.net.nz> --- Created attachment 147671 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=147671&action=edit Bug 32686: Specify action of action_logs to purge Add --log-action parameter to cleanup_database.pl Test plan: 1. Apply patch 2. Enable cataloguing and borrowers log 3. Make some changes to borrowers, create some borrowers, and edit some biblio records 4. Change the action_logs.timestamp for all action_logs entries to 367 days ago 5. Run cleanup_database.pl with --logs 365 --log-module=MEMBERS --log-action=CREATE --confirm 6. Confirm only the borrowers creation action_logs entries are removed 7. Run cleanup_database.pl with --logs 365 8. Confirm all action_logs entries are removed Sponsored-By: Toi Ohomai Institute of Technology, New Zealand Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32686 Alex Buckley <alexbuckley@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Passed QA --- Comment #9 from Alex Buckley <alexbuckley@catalyst.net.nz> --- (In reply to Tomás Cohen Arazi from comment #7)
Please rebase.
Attached rebased patch, setting back to it's previous status of 'Passed QA', please change the status if that is incorrect. Thanks -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32686 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |23.05.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32686 --- Comment #10 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed to master for 23.05. Nice work everyone, thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32686 Jacob O'Mara <jacob.omara@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |Needs documenting CC| |jacob.omara@ptfs-europe.com --- Comment #11 from Jacob O'Mara <jacob.omara@ptfs-europe.com> --- Enhancement - not backporting to 22.11.x Nice work everyone! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32686 Aude Charillon <aude.charillon@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Documentation| |Aude Charillon contact| | CC| |aude.charillon@openfifth.co | |.uk Documentation| |https://gitlab.com/koha-com submission| |munity/koha-manual/-/merge_ | |requests/1168 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32686 Aude Charillon <aude.charillon@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|Needs documenting |RESOLVED --- Comment #12 from Aude Charillon <aude.charillon@openfifth.co.uk> --- Added to the Koha Manual. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org