|
Lines 20485-20490
INSERT IGNORE INTO `letter` (`module`, `code`, `branchcode`, `name`, `is_html`,
Link Here
|
| 20485 |
print "Upgrade to $DBversion done (Bug 23354 - Add point of sale permissions)\n"; |
20485 |
print "Upgrade to $DBversion done (Bug 23354 - Add point of sale permissions)\n"; |
| 20486 |
} |
20486 |
} |
| 20487 |
|
20487 |
|
|
|
20488 |
$DBversion = '19.12.00.010'; |
| 20489 |
if( CheckVersion( $DBversion ) ) { |
| 20490 |
if( !column_exists( 'oai_sets_mappings', 'rule_order' ) ) { |
| 20491 |
$dbh->do( "ALTER TABLE oai_sets_mappings ADD COLUMN rule_order INT AFTER set_id, ADD COLUMN rule_operator VARCHAR(3) AFTER rule_order" ); |
| 20492 |
$dbh->do( "UPDATE oai_sets_mappings SET rule_operator='or'" ); |
| 20493 |
my $sets = $dbh->selectall_arrayref("SELECT * from oai_sets_mappings ORDER BY set_id", { Slice => {} }); |
| 20494 |
my $i = 0; |
| 20495 |
my $previous_set_id; |
| 20496 |
for my $set ( @{$sets}) { |
| 20497 |
my $set_id = $set->{set_id}; |
| 20498 |
|
| 20499 |
if ($previous_set_id && $previous_set_id != $set_id) { |
| 20500 |
$i = 0; |
| 20501 |
} |
| 20502 |
|
| 20503 |
if ($i == 0) { |
| 20504 |
$dbh->do("UPDATE oai_sets_mappings SET rule_operator=NULL WHERE set_id=? LIMIT 1", {}, $set_id); |
| 20505 |
} |
| 20506 |
|
| 20507 |
$dbh->do("UPDATE oai_sets_mappings SET rule_order=? WHERE set_id=? AND rule_order IS NULL LIMIT 1", {}, $i, $set_id); |
| 20508 |
|
| 20509 |
$i++; |
| 20510 |
$previous_set_id = $set_id; |
| 20511 |
} |
| 20512 |
} |
| 20513 |
|
| 20514 |
SetVersion( $DBversion ); |
| 20515 |
print "Upgrade to $DBversion done (Bug 21520 - Add rule_order and rule_operator fields to oai_sets_mappings table)\n"; |
| 20516 |
} |
| 20517 |
|
| 20488 |
# SEE bug 13068 |
20518 |
# SEE bug 13068 |
| 20489 |
# if there is anything in the atomicupdate, read and execute it. |
20519 |
# if there is anything in the atomicupdate, read and execute it. |
| 20490 |
my $update_dir = C4::Context->config('intranetdir') . '/installer/data/mysql/atomicupdate/'; |
20520 |
my $update_dir = C4::Context->config('intranetdir') . '/installer/data/mysql/atomicupdate/'; |
| 20491 |
- |
|
|