From 87a3a627f18f2874fd87def30536693afe36e359 Mon Sep 17 00:00:00 2001 From: Colin Campbell Date: Fri, 22 Jan 2010 15:33:13 +0000 Subject: [PATCH] column was added in two separate updates 3.01.00.068 duplicates the operations of 3.01.00.065 Because one column has already been created, populated and dropped the rest of the update fails --- installer/data/mysql/updatedatabase.pl | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index fe440b7277..6cba8d6c2e 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -2758,17 +2758,9 @@ $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`, - ADD COLUMN `renewalsallowed` smallint(6) default NULL, ADD COLUMN `reservesallowed` smallint(6) default NULL; "); - my $sth = $dbh->prepare("SELECT itemtype, renewalsallowed FROM itemtypes"); - $sth->execute(); - my $sthupd = $dbh->prepare("UPDATE issuingrules SET renewalsallowed = ? WHERE itemtype = ?"); - while(my $row = $sth->fetchrow_hashref){ - $sthupd->execute($row->{renewalsallowed}, $row->{itemtype}); - } - $dbh->do('ALTER TABLE itemtypes DROP COLUMN `renewalsallowed`;'); - print "Upgrade done (Adding finedays renewalsallowed, and reservesallowed fields in issuingrules table)\n"; + print "Upgrade done (Adding finedays and reservesallowed fields in issuingrules table)\n"; } -- 2.39.5