From 3742a2f4b416d6fa7f722ac6254035a87f931d89 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 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 6bf358d..cd1bc67 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -7751,8 +7751,8 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { } $DBversion = "3.15.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.2.5