|
Lines 1-45
Link Here
|
| 1 |
$DBversion = 'XXX'; # will be replaced by the RM |
1 |
$DBversion = 'XXX'; # will be replaced by the RM |
| 2 |
if( CheckVersion( $DBversion ) ) { |
2 |
if( CheckVersion( $DBversion ) ) { |
| 3 |
my @columns = qw( |
3 |
my @columns = qw( |
| 4 |
restrictedtype |
4 |
restrictedtype |
| 5 |
rentaldiscount |
5 |
rentaldiscount |
| 6 |
fine |
6 |
fine |
| 7 |
finedays |
7 |
finedays |
| 8 |
maxsuspensiondays |
8 |
maxsuspensiondays |
| 9 |
firstremind |
9 |
firstremind |
| 10 |
chargeperiod |
10 |
chargeperiod |
| 11 |
chargeperiod_charge_at |
11 |
chargeperiod_charge_at |
| 12 |
accountsent |
12 |
accountsent |
| 13 |
issuelength |
13 |
issuelength |
| 14 |
lengthunit |
14 |
lengthunit |
| 15 |
hardduedate |
15 |
hardduedate |
| 16 |
hardduedatecompare |
16 |
hardduedatecompare |
| 17 |
renewalsallowed |
17 |
renewalsallowed |
| 18 |
renewalperiod |
18 |
renewalperiod |
| 19 |
norenewalbefore |
19 |
norenewalbefore |
| 20 |
auto_renew |
20 |
auto_renew |
| 21 |
no_auto_renewal_after |
21 |
no_auto_renewal_after |
| 22 |
no_auto_renewal_after_hard_limit |
22 |
no_auto_renewal_after_hard_limit |
| 23 |
reservesallowed |
23 |
reservesallowed |
| 24 |
holds_per_record |
24 |
holds_per_record |
| 25 |
overduefinescap |
25 |
overduefinescap |
| 26 |
cap_fine_to_replacement_price |
26 |
cap_fine_to_replacement_price |
| 27 |
onshelfholds |
27 |
onshelfholds |
| 28 |
opacitemholds |
28 |
opacitemholds |
| 29 |
article_requests |
29 |
article_requests |
| 30 |
); |
30 |
); |
| 31 |
|
31 |
|
| 32 |
if ( column_exists( 'issuingrules', 'categorycode' ) ) { |
32 |
if ( column_exists( 'issuingrules', 'categorycode' ) ) { |
| 33 |
foreach my $column ( @columns ) { |
33 |
foreach my $column ( @columns ) { |
| 34 |
$dbh->do(" |
34 |
$dbh->do(" |
| 35 |
INSERT INTO circulation_rules ( categorycode, branchcode, itemtype, rule_name, rule_value ) |
35 |
INSERT INTO circulation_rules ( categorycode, branchcode, itemtype, rule_name, rule_value ) |
| 36 |
SELECT categorycode, branchcode, itemtype, 'column', $column |
36 |
SELECT categorycode, branchcode, itemtype, \'$column\', $column |
| 37 |
FROM issuingrules |
37 |
FROM issuingrules |
| 38 |
"); |
38 |
"); |
| 39 |
} |
39 |
} |
| 40 |
$dbh->do("DROP TABLE issuingrules"); |
40 |
$dbh->do("DROP TABLE issuingrules"); |
| 41 |
} |
41 |
} |
| 42 |
|
42 |
|
| 43 |
SetVersion( $DBversion ); |
43 |
SetVersion( $DBversion ); |
| 44 |
print "Upgrade to $DBversion done (Bug 18930 - Move lost item refund rules to circulation_rules table)\n"; |
44 |
print "Upgrade to $DBversion done (Bug 18936: Convert issuingrules fields to circulation_rules)\n"; |
| 45 |
} |
45 |
} |
| 46 |
- |
|
|