1 $DBversion = 'XXX'; # will be replaced by the RM
2 if ( CheckVersion($DBversion) ) {
4 if ( !column_exists( 'itemtypes', 'rentalcharge_daily' ) ) {
5 $dbh->do("ALTER TABLE `itemtypes` ADD COLUMN `rentalcharge_daily` decimal(28,6) default NULL AFTER `rentalcharge`");
8 if ( !column_exists( 'itemtypes', 'rentalcharge_hourly' ) ) {
9 $dbh->do("ALTER TABLE `itemtypes` ADD COLUMN `rentalcharge_hourly` decimal(28,6) default NULL AFTER `rentalcharge_daily`");
12 if ( column_exists( 'itemtypes', 'rental_charge_daily' ) ) {
13 $dbh->do("UPDATE `itemtypes` SET `rentalcharge_daily` = `rental_charge_daily`");
14 $dbh->do("ALTER TABLE `itemtypes` DROP COLUMN `rental_charge_daily`");
17 SetVersion($DBversion);
18 print "Upgrade to $DBversion done (Bug 20912 - Support granular rental charges)\n";