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

(-)a/installer/data/mysql/atomicupdate/bug_22024-splitting-rules.perl (-1 / +40 lines)
Line 0 Link Here
0
- 
1
$DBversion = 'XXX';  # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
3
4
5
    # On a new installation the class_sources.sql will have failed, so we need to add all missing data
6
7
    my( $sort_cnt ) = $dbh->selectrow_array( q|SELECT COUNT(*) FROM class_sort_rules|);
8
    if( !$sort_cnt ) {
9
        $dbh->do(q|INSERT INTO `class_sort_rules` (`class_sort_rule`, `description`, `sort_routine`) VALUES
10
                               ('dewey', 'Default filing rules for DDC', 'Dewey'),
11
                               ('lcc', 'Default filing rules for LCC', 'LCC'),
12
                               ('generic', 'Generic call number filing rules', 'Generic')
13
            |);
14
    }
15
16
    my ( $split_cnt ) = $dbh->selectrow_array( q|SELECT COUNT(*) FROM class_split_rules|);
17
    if( !$split_cnt ) {
18
        $dbh->do(q|INSERT INTO `class_split_rules` (`class_split_rule`, `description`, `split_routine`) VALUES
19
                               ('dewey', 'Default splitting rules for DDC', 'Dewey'),
20
                               ('lcc', 'Default splitting rules for LCC', 'LCC'),
21
                               ('generic', 'Generic call number splitting rules', 'Generic')
22
            |);
23
    }
24
25
    my( $source_cnt ) = $dbh->selectrow_array( q|SELECT COUNT(*) FROM class_sources|);
26
    if( !$source_cnt ) {
27
        $dbh->do(q|INSERT INTO `class_sources` (`cn_source`, `description`, `used`, `class_sort_rule`, `class_split_rule`) VALUES
28
                            ('ddc', 'Dewey Decimal Classification', 1, 'dewey', 'dewey'),
29
                            ('lcc', 'Library of Congress Classification', 1, 'lcc', 'lcc'),
30
                            ('udc', 'Universal Decimal Classification', 0, 'generic', 'generic'),
31
                            ('sudocs', 'SuDoc Classification (U.S. GPO)', 0, 'generic', 'generic'),
32
                            ('anscr', 'ANSCR (Sound Recordings)', 0, 'generic', 'generic'),
33
                            ('z', 'Other/Generic Classification Scheme', 0, 'generic', 'generic')
34
            |);
35
    
36
    }
37
38
    SetVersion( $DBversion );
39
    print "Upgrade to $DBversion done (Bug 22024 - Add missing splitting rule definitions)\n";
40
}

Return to bug 22024