misc/cronjobs/cleanup_database.pl provides some database cleanup. Yet some tables that could need cleanup are not in this script. Purge messages older than day (default 365).
Created attachment 98152 [details] [review] Bug 24541: Purge old messages misc/cronjobs/cleanup_database.pl provides some database cleanup. This patch adds cleanup for messages table. Test plan : - Count messages : select count(*),date(message_date) from messages group by date(message_date); - Run cleanup : misc/cronjobs/cleanup_database.pl -v --messages 365 - Recount messages
Please rebase
Created attachment 101509 [details] [review] Attachment to Bug 24541 - Database cleanups, purge messages Bug 24541: Purge old messages misc/cronjobs/cleanup_database.pl provides some database cleanup. This patch adds cleanup for messages table. Test plan : - Count messages : select count(*),date(message_date) from messages group by date(message_date); - Run cleanup : misc/cronjobs/cleanup_database.pl -v --messages 365 - Recount messages
Created attachment 101541 [details] [review] Bug 24541: Purge old messages misc/cronjobs/cleanup_database.pl provides some database cleanup. This patch adds cleanup for messages table. Test plan : - Count messages : select count(*),date(message_date) from messages group by date(message_date); - Run cleanup : misc/cronjobs/cleanup_database.pl -v --messages 365 - Recount messages Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Works Ok, no errors.
I have a patch that is enhancing greatly this script. By any chances could base yours on top of it? See bug 24153.
(In reply to Jonathan Druart from comment #5) > I have a patch that is enhancing greatly this script. By any chances could > base yours on top of it? > > See bug 24153. Nevermind, I will do it later.
Created attachment 107369 [details] [review] Bug 24541: Purge old messages misc/cronjobs/cleanup_database.pl provides some database cleanup. This patch adds cleanup for messages table. Test plan : - Count messages : select count(*),date(message_date) from messages group by date(message_date); - Run cleanup : misc/cronjobs/cleanup_database.pl -v --confirm --messages 365 - Recount messages
rebase and follow --confirm flag
Didier, please use Koha::Patron::Messages->filter_by_last_update See the occurrences of 'filter_by_last_update' in this script.
Created attachment 107415 [details] [review] Bug 24541: Purge old messages misc/cronjobs/cleanup_database.pl provides some database cleanup. This patch adds cleanup for messages table. Test plan : - Count messages : select count(*),date(message_date) from messages group by date(message_date); - Run cleanup : misc/cronjobs/cleanup_database.pl -v --confirm --messages 365 - Recount messages
use Koha::Patron::Messages->filter_by_last_update
Created attachment 112933 [details] [review] Bug 24541: Purge old messages misc/cronjobs/cleanup_database.pl provides some database cleanup. This patch adds cleanup for messages table. Test plan : - Count messages : select count(*),date(message_date) from messages group by date(message_date); - Run cleanup : misc/cronjobs/cleanup_database.pl -v --confirm --messages 365 - Recount messages Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Works fine and respects the use of 'confirm' flag. Nice one :)
Created attachment 114711 [details] [review] Bug 24541: Purge old messages misc/cronjobs/cleanup_database.pl provides some database cleanup. This patch adds cleanup for messages table. Test plan : - Count messages : select count(*),date(message_date) from messages group by date(message_date); - Run cleanup : misc/cronjobs/cleanup_database.pl -v --confirm --messages 365 - Recount messages Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Works as expected, QA script ok, code ok.
Pushed to master for 21.05, thanks to everybody involved!
Small enhancement, I choose to backport. Pushed to 20.11.x for 20.11.02
Enhancement, not backporting to 20.05. Please ask if needed