Bug 30069: (QA follow-up) Rebase and add filter
authorMatt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Wed, 1 Mar 2023 15:13:48 +0000 (15:13 +0000)
committerTomas Cohen Arazi <tomascohen@theke.io>
Thu, 2 Mar 2023 15:00:21 +0000 (12:00 -0300)
commit6b90fa3ec4ca7ec9515a59527fb9ff7f4d823318
tree242c1154b87236d61c4fe3d9d722dd7630f0c5c6
parentee91389edd76297c2a553a65d7ec5f89ab2e97d0
Bug 30069: (QA follow-up) Rebase and add filter

This patch now checks the status of messages and ignores any message
with a status of 'new'. It is also rebased to account for changes made
to cleanup_database.pl in bug 17350.

Test plan:
1) Ensure you have some EDI orders or even just some dummy messages in the edifact_messages table with a mixture of statuses including 'new'
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
7) Confirm that no messages marked 'new' have been deleted

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
misc/cronjobs/cleanup_database.pl