Bug 20912: (QA follow-up) Add on_editing to $Price filter
[koha.git] / installer / data / mysql / atomicupdate / bug_20912.perl
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', 'rentalcharge_hourly' ) ) {
9         $dbh->do("ALTER TABLE `itemtypes` ADD COLUMN `rentalcharge_hourly` decimal(28,6) default NULL AFTER `rentalcharge_daily`");
10     }
11
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`");
15     }
16
17     SetVersion($DBversion);
18     print "Upgrade to $DBversion done (Bug 20912 - Support granular rental charges)\n";
19 }