Bug 17350 - Add option to delete data stored in saved_reports with cleanup_database
Summary: Add option to delete data stored in saved_reports with cleanup_database
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Reports (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement
Assignee: Andrew Fuerste-Henry
QA Contact: Katrin Fischer
URL:
Keywords:
Depends on: 14435
Blocks:
  Show dependency treegraph
 
Reported: 2016-09-26 05:18 UTC by Katrin Fischer
Modified: 2023-12-28 20:46 UTC (History)
8 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.05.00
Circulation function:


Attachments
Bug 17350: Purge old saved reports via cleanup_database (2.77 KB, patch)
2022-11-21 20:02 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review
Bug 17350: Purge old saved reports via cleanup_database (2.79 KB, patch)
2023-01-27 11:32 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 17350: Add note about how the saved reports data is created in first place (1.38 KB, patch)
2023-01-27 11:32 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 17350: Purge old saved reports via cleanup_database (2.85 KB, patch)
2023-02-26 04:18 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review
Bug 17350: Add note about how the saved reports data is created in first place (1.43 KB, patch)
2023-02-26 04:18 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2016-09-26 05:18:40 UTC
This is a follow-up bug to bug 14435 which reactivates an old feature that allows you to store the results of a run report in saved_reports.

Now that this will work again, there should also be an option to clean up the data stored - either from the script, the GUI or ideally from both.
Comment 1 AspenCat Team 2018-12-12 04:32:53 UTC
One should have the option to specify the number of results to keep (for example keep two on a report scheduled to run daily, as well as the option to delete saved results - perhaps with a "select all" when viewing saved results for a particular report.
Comment 2 Danielle Elder 2019-02-15 16:44:28 UTC
I do get requests from libraries to "clean this up". It does interfere with usability.
Comment 3 Andrew Fuerste-Henry 2022-11-18 18:09:02 UTC
+1 on this. It'd be good to have a way to delete these manually from the staff interface and also a way to set cleanup_database to do so.
Comment 4 Andrew Fuerste-Henry 2022-11-21 20:02:30 UTC
Created attachment 144116 [details] [review]
Bug 17350: Purge old saved reports via cleanup_database

To test:
apply patch
1 - have or create a report
2 - run your report via the command line with --store-results. Do this twice.
3 - update the saved_reports table to set date_run for one of your two saved results set to a datetime more than 5 days ago
4 - perl misc/cronjobs/cleanup_database.pl --reports 5 --verbose --confirm
5 - Koha tells you its deleting saved reports data from more than 5 days ago
6 - confirm in the database and the staff interface that it's done so
Comment 5 Andrew Fuerste-Henry 2022-11-21 20:08:52 UTC
I *think* I managed to write a patch to add this functionality to cleanup_databse. I've filed bug 32311 to add a way to delete these from the staff interface.
Comment 6 Katrin Fischer 2023-01-27 11:32:08 UTC
Created attachment 145721 [details] [review]
Bug 17350: Purge old saved reports via cleanup_database

To test:
apply patch
1 - have or create a report
2 - run your report via the command line with --store-results. Do this twice.
3 - update the saved_reports table to set date_run for one of your two saved results set to a datetime more than 5 days ago
4 - perl misc/cronjobs/cleanup_database.pl --reports 5 --verbose --confirm
5 - Koha tells you its deleting saved reports data from more than 5 days ago
6 - confirm in the database and the staff interface that it's done so

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Comment 7 Katrin Fischer 2023-01-27 11:32:13 UTC
Created attachment 145722 [details] [review]
Bug 17350: Add note about how the saved reports data is created in first place

This amends the documentation of the cleanup_database.pl script
to include a hint for how the saved reports data is created.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Comment 8 Victor Grousset/tuxayo 2023-02-26 04:18:37 UTC
Created attachment 147414 [details] [review]
Bug 17350: Purge old saved reports via cleanup_database

To test:
apply patch
1 - have or create a report
2 - run your report via the command line with --store-results. Do this twice.
3 - update the saved_reports table to set date_run for one of your two saved results set to a datetime more than 5 days ago
4 - perl misc/cronjobs/cleanup_database.pl --reports 5 --verbose --confirm
5 - Koha tells you its deleting saved reports data from more than 5 days ago
6 - confirm in the database and the staff interface that it's done so

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Comment 9 Victor Grousset/tuxayo 2023-02-26 04:18:40 UTC
Created attachment 147415 [details] [review]
Bug 17350: Add note about how the saved reports data is created in first place

This amends the documentation of the cleanup_database.pl script
to include a hint for how the saved reports data is created.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Comment 10 Victor Grousset/tuxayo 2023-02-26 04:19:06 UTC
Works, QA script happy, code looks good, passing QA :)
Comment 11 Tomás Cohen Arazi (tcohen) 2023-02-27 16:07:01 UTC
Pushed to master for 23.05.

Nice work everyone, thanks!