Bug 18930: Move lost item refund rules to circulation_rules table
[koha-equinox.git] / installer / data / mysql / atomicupdate / bug_18930.perl
1 $DBversion = 'XXX';  # will be replaced by the RM
2 if( CheckVersion( $DBversion ) ) {
3     if ( column_exists( 'refund_lost_item_fee_rules', 'refund' ) ) {
4         $dbh->do("
5             INSERT INTO circulation_rules ( categorycode, branchcode, itemtype, rule_name, rule_value )
6             SELECT NULL, branchcode, NULL, 'refund', refund
7             FROM refund_lost_item_fee_rules
8         ");
9         $dbh->do("DROP TABLE refund_lost_item_fee_rules");
10     }
11
12     SetVersion( $DBversion );
13     print "Upgrade to $DBversion done (Bug 18930 - Move lost item refund rules to circulation_rules table)\n";
14 }