Summary: | Specify action of action_logs entries to purge | ||
---|---|---|---|
Product: | Koha | Reporter: | Alex Buckley <alexbuckley> |
Component: | Command-line Utilities | Assignee: | Alex Buckley <alexbuckley> |
Status: | Needs documenting --- | QA Contact: | Testopia <testopia> |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | david, jacob.omara, magnus, robin, tomascohen, victor |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | Sponsored | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
23.05.00
|
|
Circulation function: | |||
Attachments: |
Bug 32686: Specify action of action_logs to purge
Bug 32686: Specify action of action_logs to purge Bug 32686: Specify action of action_logs to purge Bug 32686: Specify action of action_logs to purge |
Description
Alex Buckley
2023-01-20 02:00:21 UTC
*** Bug 32480 has been marked as a duplicate of this bug. *** Created attachment 145499 [details] [review] 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 Created attachment 145781 [details] [review] 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> 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; Created attachment 147583 [details] [review] 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> Works (including multiple --log-action), QA script happy, code looks good, passing QA :) Please rebase. Created attachment 147671 [details] [review] 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> (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 Pushed to master for 23.05. Nice work everyone, thanks! Enhancement - not backporting to 22.11.x Nice work everyone! |