From 3c5974b34028ef7e1174beba9c07c6d29a9c730e Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Fri, 17 Jan 2020 15:18:24 +0000 Subject: [PATCH] Bug 24446: Update branchtransfers.daterequested for stockrotation This database update catches existing stockration triggered branchtransfers and moves the datesent value into daterequested --- .../data/mysql/atomicupdate/bug_24446.perl | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/bug_24446.perl diff --git a/installer/data/mysql/atomicupdate/bug_24446.perl b/installer/data/mysql/atomicupdate/bug_24446.perl new file mode 100644 index 0000000000..848f5caabc --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_24446.perl @@ -0,0 +1,21 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + + # Update daterequested from datesent for stockrotation + $dbh->do( + qq{ + UPDATE + `branchtransfers` + SET + `daterequested` = `datesent`, + `datesent` = NULL + WHERE + `reason` LIKE 'Stockrotation%' + AND + `datearrived` IS NULL + } + ); + + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 24446 - Update stockrotation 'daterequested' field in transfers table)\n"; +} -- 2.20.1