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