From d9e0387080cd42e78454b3333a5e23132eafbde0 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Wed, 17 Nov 2021 16:49:27 +0000 Subject: [PATCH] Bug 29457: Database update --- installer/data/mysql/atomicupdate/bug_29457.pl | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/bug_29457.pl diff --git a/installer/data/mysql/atomicupdate/bug_29457.pl b/installer/data/mysql/atomicupdate/bug_29457.pl new file mode 100644 index 0000000000..f5589a6934 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_29457.pl @@ -0,0 +1,13 @@ +use Modern::Perl; + +return { + bug_number => "29457", + description => "Fix manager_id for historical account cancellations", + up => sub { + my ($args) = @_; + my ($dbh, $out) = @$args{qw(dbh out)}; + $dbh->do(q{ + UPDATE accountlines SET manager_id = ( SELECT borrowernumber FROM borrowers WHERE borrowers.userid = accountlines.manager_id ) WHERE credit_type_code = 'CANCELLATION'; + }); + }, +} -- 2.20.1