From e99d1609889ae0895b3abfe7e05344be4601f36d 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 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This database update catches existing stockrotation triggered branchtransfers and moves the datesent value into daterequested Signed-off-by: Kathleen Milne Signed-off-by: Martin Renvoize Signed-off-by: Joonas Kylmälä --- .../data/mysql/atomicupdate/bug_24446.perl | 20 +++++++++++++++++++ 1 file changed, 20 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..c335f8adf7 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_24446.perl @@ -0,0 +1,20 @@ +$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 + } + ); + + NewVersion( $DBversion, 24446, "Update stockrotation 'daterequested' field in transfers table" ); +} -- 2.20.1