|
Lines 23-28
return {
Link Here
|
| 23 |
}, undef, $rule_name); |
23 |
}, undef, $rule_name); |
| 24 |
} |
24 |
} |
| 25 |
say $out "Removed orphan records in circulation_rules and false positives after attempt to fix values to be empty or zeroes instead of missing"; |
25 |
say $out "Removed orphan records in circulation_rules and false positives after attempt to fix values to be empty or zeroes instead of missing"; |
|
|
26 |
$dbh->do(q{ |
| 27 |
DELETE FROM circulation_rules WHERE id in ( |
| 28 |
SELECT id FROM ( |
| 29 |
SELECT id FROM circulation_rules cr WHERE rule_name = "unseenrenewalsallowed" AND EXISTS ( |
| 30 |
SELECT NULL FROM circulation_rules cr2 |
| 31 |
WHERE |
| 32 |
cr2.rule_name="unseen_renewals_allowed" |
| 33 |
AND ( (cr2.branchcode=cr.branchcode) OR ( ISNULL(cr2.branchcode) AND ISNULL(cr.branchcode) ) ) |
| 34 |
AND ( (cr2.categorycode=cr.categorycode) OR ( ISNULL(cr2.categorycode) AND ISNULL(cr.categorycode) ) ) |
| 35 |
AND ( (cr2.itemtype=cr.itemtype) OR ( ISNULL(cr2.itemtype) AND ISNULL(cr.itemtype) ) ) |
| 36 |
) |
| 37 |
) AS ids |
| 38 |
) |
| 39 |
}, undef, $rule_name); |
| 40 |
say $out "Removed unseenrenewalsallowed rules that duplicate unseen_renewals_allowed rules"; |
| 26 |
$dbh->do(q{UPDATE circulation_rules SET rule_name = "unseen_renewals_allowed" WHERE rule_name = "unseenrenewalsallowed"}); |
41 |
$dbh->do(q{UPDATE circulation_rules SET rule_name = "unseen_renewals_allowed" WHERE rule_name = "unseenrenewalsallowed"}); |
| 27 |
say $out "Renamed unseenrenewalsallowed to unseen_renewals_allowed in circulation_rules"; |
42 |
say $out "Renamed unseenrenewalsallowed to unseen_renewals_allowed in circulation_rules"; |
| 28 |
}, |
43 |
}, |
| 29 |
- |
|
|