From d5e3e86cb853c80ef5d9b0368be205608287fe85 Mon Sep 17 00:00:00 2001 From: Lari Taskula Date: Wed, 9 Oct 2019 09:43:05 +0000 Subject: [PATCH] Bug 18595: Validate days_in_advance --- .../Bug-18595-1-Validate-days-in-advance.perl | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/Bug-18595-1-Validate-days-in-advance.perl diff --git a/installer/data/mysql/atomicupdate/Bug-18595-1-Validate-days-in-advance.perl b/installer/data/mysql/atomicupdate/Bug-18595-1-Validate-days-in-advance.perl new file mode 100644 index 0000000000..fb0726894c --- /dev/null +++ b/installer/data/mysql/atomicupdate/Bug-18595-1-Validate-days-in-advance.perl @@ -0,0 +1,9 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + + $dbh->do("UPDATE borrower_message_preferences SET days_in_advance=NULL WHERE days_in_advance IS NOT NULL AND message_attribute_id IN (SELECT message_attribute_id FROM message_attributes WHERE takes_days=0)"); + + # Always end with this (adjust the bug info) + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 18595-1 - Validate days_in_advance values in borrower_message_preferences table)\n"; +} -- 2.17.1