From 34bbcb4efacac5ba3436d3ee1d23acefa42e76a6 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 2 May 2014 17:03:56 +0200 Subject: [PATCH] Bug 11867: Change the sql query in order to win beauty prices --- 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 d70604d..72c6449 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -8071,29 +8071,33 @@ if ( C4::Context->preference("Version") < TransformToNum($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 XXXXX: Update letters *_PHONE)\n"; SetVersion($DBversion); -- 1.7.10.4