From b35931016392930ec502b6e3d37653bc93bf264b Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 2 May 2014 17:03:56 +0200 Subject: [PATCH] Bug 11867: (follow-up) Change the sql query in order to win beauty prices Signed-off-by: Galen Charlton --- installer/data/mysql/updatedatabase.pl | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 7ad52f6181..13eda609e2 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -8315,29 +8315,33 @@ if ( CheckVersion($DBversion) ) { $DBversion = "3.15.00.XXX"; if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { + my $name = $dbh->selectcol_arrayref(q| + SELECT name FROM letter WHERE code="HOLD" + |); + $name = $name->[0]; $dbh->do(q| UPDATE letter SET code="HOLD", message_transport_type="phone", - name=(SELECT name FROM ( SELECT name FROM letter WHERE code="HOLD" LIMIT 1 ) AS t) + name= ? WHERE code="HOLD_PHONE" - |); + |, {}, $name); $dbh->do(q| UPDATE letter SET code="PREDUE", message_transport_type="phone", - name=(SELECT name FROM ( SELECT name FROM letter WHERE code="HOLD" LIMIT 1 ) AS t) + name= ? WHERE code="PREDUE_PHONE" - |); + |, {}, $name); $dbh->do(q| UPDATE letter SET code="OVERDUE", message_transport_type="phone", - name=(SELECT name FROM ( SELECT name FROM letter WHERE code="HOLD" LIMIT 1 ) AS t) + name= ? WHERE code="OVERDUE_PHONE" - |); + |, {}, $name); print "Upgrade to $DBversion done (Bug 11867: Update letters *_PHONE)\n"; SetVersion($DBversion); -- 2.39.5