Bug 12760 - add restrictions purge to cleanup_database.pl
authorFridolin Somers <fridolin.somers@biblibre.com>
Thu, 14 Aug 2014 12:56:26 +0000 (14:56 +0200)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Fri, 7 Nov 2014 14:32:22 +0000 (11:32 -0300)
commit5f58431380c2ec753f4e69628c4edce82223ae9d
tree1ac6afdc1608fb95618c877e461e138e775bc123
parent81445f9e889c5f87a922fbfd7e7156d220a62cd7
Bug 12760 - add restrictions purge to cleanup_database.pl

This patch adds to the database cleanup script an option to purge expired patron restrictions (debarments in code).

Test plan :
- Select a borrower
- Create a restriction with expiration date in the futur
- Create a restriction expired since 7 days
- Create a restriction expired since 14 days
- run "misc/cronjobs/cleanup_database.pl -v --restrictions 14"
=> no restriction is removed for this borrower
- run "misc/cronjobs/cleanup_database.pl -v --restrictions 13"
=> restriction expired since 14 days is removed
- run "misc/cronjobs/cleanup_database.pl -v --restrictions 6"
=> restriction expired since 7 days is removed
- run without argument "misc/cronjobs/cleanup_database.pl"
=> You see help text for restrictions option
- run without days "misc/cronjobs/cleanup_database.pl -v --restrictions"
=> You get a purge on 30 days

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
misc/cronjobs/cleanup_database.pl