3cdaf8a9586555fc1adc64f9be34def53eee6b72
[koha_ffzg] / installer / data / mysql / atomicupdate / bug_21747.perl
1 $DBversion = 'XXX';  # will be replaced by the RM
2 if( CheckVersion( $DBversion ) ) {
3     $dbh->do(q{
4         INSERT IGNORE INTO account_offset_types ( type ) VALUES ( 'fine_increase' ), ( 'fine_decrease' );
5     });
6
7     $dbh->do(q{
8         UPDATE account_offsets SET type = 'fine_increase' WHERE type = 'Fine Update' AND amount > 0;
9     });
10
11     $dbh->do(q{
12         UPDATE account_offsets SET type = 'fine_decrease' WHERE type = 'Fine Update' AND amount < 0;
13     });
14
15     $dbh->do(q{
16         DELETE FROM account_offset_types WHERE type = 'Fine Update';
17     });
18
19     SetVersion( $DBversion );
20     print "Upgrade to $DBversion done (Bug 21747 - Update account_offset_types to include 'fine_increase' and 'fine_decrease')\n";
21 }