5 my $dbh=C4::Context->dbh;
6 $dbh->do("ALTER TABLE issuingrules ADD
7 COLUMN `finedays` int(11) default NULL AFTER `fine`,
8 COLUMN `renewalsallowed` smallint(6) default NULL,
9 COLUMN `reservesallowed` smallint(6) default NULL,
11 my $sth = $dbh->prepare("SELECT itemtype, renewalsallowed FROM itemtypes");
14 my $sthupd = $dbh->prepare("UPDATE issuingrules SET renewalsallowed = ? WHERE itemtype = ?");
16 while(my $row = $sth->fetchrow_hashref){
17 $sthupd->execute($row->{renewalsallowed}, $row->{itemtype});
20 $dbh->do('ALTER TABLE itemtypes DROP COLUMN `renewalsallowed`;');
22 print "Upgrade done (Adding finedays renewalsallowed, and reservesallowed fields in issuingrules table)\n";