From c7b4cb1f8d68630bb7b1a108d124424351f9b9f5 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Wed, 24 Apr 2019 09:05:33 +0100 Subject: [PATCH] Bug 11573: Update existing accountlines for 'Rent' Signed-off-by: Martin Renvoize --- .../data/mysql/atomicupdate/bug_11573.perl | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/bug_11573.perl diff --git a/installer/data/mysql/atomicupdate/bug_11573.perl b/installer/data/mysql/atomicupdate/bug_11573.perl new file mode 100644 index 0000000000..93a002dca4 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_11573.perl @@ -0,0 +1,26 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if ( CheckVersion($DBversion) ) { + + $dbh->do(qq{ + UPDATE + accountlines + SET + accounttype = 'RENT_RENEW' + WHERE + accounttype = 'Rent' + AND + description LIKE 'Renewal of Rental Item%'; + }); + + $dbh->do(qq{ + UPDATE + accountlines + SET + accounttype = 'RENT' + WHERE + accounttype = 'Rent'; + }); + + SetVersion($DBversion); + print "Upgrade to $DBversion done (Bug 11573 - Fix accounttypes for 'Rent')\n"; +} -- 2.20.1