View | Details | Raw Unified | Return to bug 20912
Collapse All | Expand All

(-)a/installer/data/mysql/atomicupdate/bug_20912.perl (+15 lines)
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
}
(-)a/installer/data/mysql/atomicupdate/bug_20912.sql (-2 lines)
Line 1 Link Here
1
ALTER TABLE itemtypes ADD COLUMN rental_charge_daily decimal(28,6) default NULL AFTER rentalcharge;
2
- 

Return to bug 20912