View | Details | Raw Unified | Return to bug 10811
Collapse All | Expand All

(-)a/installer/data/mysql/en/marcflavour/marc21/optional/marc21_default_matching_rules.sql (+8 lines)
Lines 36-38 INSERT INTO matchpoint_components (matchpoint_id, sequence, tag, subfields) Link Here
36
INSERT INTO matchpoint_component_norms (matchpoint_component_id, sequence, norm_routine) 
36
INSERT INTO matchpoint_component_norms (matchpoint_component_id, sequence, norm_routine) 
37
    SELECT MAX(matchpoint_component_id), 1, 'ISSN' FROM matchpoint_components;
37
    SELECT MAX(matchpoint_component_id), 1, 'ISSN' FROM matchpoint_components;
38
38
39
INSERT INTO marc_matchers (code, description, record_type, threshold)
40
    VALUES ('KohaBiblio', '999$c', 'biblio', 1000);
41
INSERT INTO matchpoints (matcher_id, search_index, score) SELECT MAX(matcher_id), 'Local-Number', 1000 FROM marc_matchers;
42
INSERT INTO matcher_matchpoints SELECT MAX(matcher_id), MAX(matchpoint_id) FROM matchpoints;
43
INSERT INTO matchpoint_components (matchpoint_id, sequence, tag, subfields)
44
    SELECT MAX(matchpoint_id), 1, '999', 'c' FROM matchpoints;
45
INSERT INTO matchpoint_component_norms (matchpoint_component_id, sequence, norm_routine)
46
    SELECT MAX(matchpoint_component_id), 1, 'Biblionumber' FROM matchpoint_components;
(-)a/installer/data/mysql/updatedatabase.pl (-1 / +13 lines)
Lines 7912-7917 if ( CheckVersion($DBversion) ) { Link Here
7912
    SetVersion($DBversion);
7912
    SetVersion($DBversion);
7913
}
7913
}
7914
7914
7915
$DBversion = "3.13.00.XXX";
7916
if ( CheckVersion($DBversion) ) {
7917
    if ( C4::Context->preference("marcflavour") eq 'MARC21' ) {
7918
        $dbh->do("INSERT INTO marc_matchers (code, description, record_type, threshold) VALUES ('KohaBiblio', '999\$c', 'biblio', 1000)");
7919
        $dbh->do("INSERT INTO matchpoints (matcher_id, search_index, score) SELECT MAX(matcher_id), 'Local-Number', 1000 FROM marc_matchers");
7920
        $dbh->do("INSERT INTO matcher_matchpoints SELECT MAX(matcher_id), MAX(matchpoint_id) FROM matchpoints");
7921
        $dbh->do("INSERT INTO matchpoint_components (matchpoint_id, sequence, tag, subfields) SELECT MAX(matchpoint_id), 1, '999', 'c' FROM matchpoints");
7922
        $dbh->do("INSERT INTO matchpoint_component_norms (matchpoint_component_id, sequence, norm_routine) SELECT MAX(matchpoint_component_id), 1, 'Biblionumber' FROM matchpoint_components");
7923
    }
7924
    print "Upgrade to $DBversion done (Bug 10811: Add a 999\$c record matching rule to the MARC21 defaults)\n";
7925
    SetVersion($DBversion);
7926
}
7927
7915
=head1 FUNCTIONS
7928
=head1 FUNCTIONS
7916
7929
7917
=head2 TableExists($table)
7930
=head2 TableExists($table)
7918
- 

Return to bug 10811