`renewalperiod` int(4) default NULL, -- renewal period in the unit set in issuingrules.lengthunit
`reservesallowed` smallint(6) NOT NULL default "0", -- how many holds are allowed
`branchcode` varchar(10) NOT NULL default '', -- the branch this rule is for (branches.branchcode)
- overduefinescap decimal default NULL, -- the maximum amount of an overdue fine
+ overduefinescap decimal(28,6) default NULL, -- the maximum amount of an overdue fine
PRIMARY KEY (`branchcode`,`categorycode`,`itemtype`),
KEY `categorycode` (`categorycode`),
KEY `itemtype` (`itemtype`)
$DBversion = '3.09.00.027';
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
- $dbh->do("ALTER TABLE issuingrules ADD overduefinescap decimal DEFAULT NULL");
+ $dbh->do("ALTER TABLE issuingrules ADD overduefinescap decimal(28,6) DEFAULT NULL");
my $maxfine = C4::Context->preference('MaxFine');
if ($maxfine && $maxfine < 900) { # an arbitrary value that tells us it's not "some huge value"
$dbh->do("UPDATE issuingrules SET overduefinescap=?",undef,$maxfine);
SetVersion($DBversion);
}
+
+$DBversion = "3.13.00.XXX";
+if ( CheckVersion($DBversion) ) {
+ $dbh->do("ALTER TABLE issuingrules MODIFY COLUMN overduefinescap decimal(28,6) DEFAULT NULL;");
+ print "Upgrade to $DBversion done (Bug 10490: Correct datatype for overduefinescap in issuingrules)\n";
+ SetVersion($DBversion);
+}
+
=head1 FUNCTIONS
=head2 TableExists($table)