From 51241b66b277a5e4ed21e9d34ed5c9ea44cee82c Mon Sep 17 00:00:00 2001 From: Henri-Damien LAURENT Date: Thu, 10 Dec 2009 11:02:55 +0100 Subject: [PATCH] bug Fixing: updatedatabase Here comes a patch for update database. Can you please test and tell me if it works ? Thanks a lot --- installer/data/mysql/updatedatabase.pl | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 41dfa3f515..e2edf01f1e 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -2725,8 +2725,12 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { $DBversion = '3.01.00.066'; if (C4::Context->preference("Version") < TransformToNum($DBversion)) { - $dbh->do('ALTER TABLE issuingrules ADD COLUMN `reservesallowed` smallint(6) NOT NULL default "0" AFTER `renewalsallowed`;'); - + $dbh->do("ALTER TABLE issuingrules + ADD COLUMN `finedays` int(11) default NULL AFTER `fine`, + ADD COLUMN `renewalsallowed` smallint(6) default NULL, + ADD COLUMN `reservesallowed` smallint(6) default NULL; + "); + my $maxreserves = C4::Context->preference('maxreserves'); $sth = $dbh->prepare('UPDATE issuingrules SET reservesallowed = ?;'); $sth->execute($maxreserves); @@ -2748,8 +2752,6 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { $DBversion = "3.01.00.068"; if (C4::Context->preference("Version") < TransformToNum($DBversion)) { - $dbh->do("ALTER TABLE issuingrules ADD COLUMN `finedays` int(11) default NULL AFTER `fine` "); - print "Upgrade done (Adding finedays in issuingrules table)\n"; } @@ -2905,7 +2907,7 @@ ADDPERIODS $dbh->do(<selectcol_arrayref(<