Bug 30069: Add edifact-messages to cleanup_database.pl
authorMatt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Wed, 15 Feb 2023 14:20:54 +0000 (14:20 +0000)
committerTomas Cohen Arazi <tomascohen@theke.io>
Thu, 2 Mar 2023 15:00:19 +0000 (12:00 -0300)
commit2b085842554607c08d7b5672b129313008cc619b
tree89f4dfae25509feb7c3be25a5c4d39ec8870e548
parent834e3c8e0ea4ad82ab4825e8994164cc85b2836f
Bug 30069: Add edifact-messages to cleanup_database.pl

This patch allows users to clear out old edifact_messages using the cleanup_database script. The number of days can either be set in the CLI or the default value of 365 can be used.

Test plan:
1) Ensure you have some EDI orders or even just some dummy messages in the edifact_messages table
2) Run perl misc/cronjobs/cleanup_database.pl --edifact-messages 100 --verbose (Change the number of days according to the data in your table)
3) The response should show a number of messages that would have been deleted
4) Run perl misc/cronjobs/cleanup_database.pl --edifact-messages 100 --verbose --confirm
5) The response should now show the same number of messages have been deleted
6) Check your edifact_messages table to confirm that the data has been deleted

Sponsored-by: PTFS Europe
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
misc/cronjobs/cleanup_database.pl