From 7469181278e39ae0aa91e63fd87164859c43fce0 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Wed, 2 Oct 2013 14:05:20 +0200 Subject: [PATCH] Bug 4045: Followup for optional insertion of maxreserves Content-Type: text/plain; charset=utf-8 Adds IGNORE to the INSERT statement. Since this is in the mysql folder, that should be allowed ;) Also: Do the version check via CheckVersion. Test plan: Run webinstaller updatestructure step. --- installer/data/mysql/updatedatabase.pl | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 27c73e0..dc35978 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -7156,8 +7156,8 @@ if ( CheckVersion($DBversion) ) { } $DBversion = "3.13.00.XXX"; -if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { - $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('maxreserves',50,'System-wide maximum number of holds a patron can place','','Integer')"); +if ( CheckVersion($DBversion) ) { + $dbh->do("INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES ('maxreserves',50,'System-wide maximum number of holds a patron can place','','Integer')"); print "Upgrade to $DBversion done (Re-add system preference maxreserves)\n"; SetVersion($DBversion); } -- 1.7.7.6