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

(-)a/installer/data/mysql/atomicupdate/bug_18235-add-search_field-facet_order.perl (+20 lines)
Line 0 Link Here
1
$DBversion = 'XXX'; # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
3
    if( !column_exists( 'search_field', 'facet_order' ) ) {
4
        $dbh->do("ALTER TABLE search_field ADD COLUMN facet_order TINYINT(4) DEFAULT NULL AFTER weight");
5
    }
6
7
    $dbh->do("UPDATE search_field SET facet_order=1 WHERE name='author'");
8
    $dbh->do("UPDATE search_field SET facet_order=2 WHERE name='itype'");
9
    $dbh->do("UPDATE search_field SET facet_order=3 WHERE name='location'");
10
    $dbh->do("UPDATE search_field SET facet_order=4 WHERE name='su-geo'");
11
    $dbh->do("UPDATE search_field SET facet_order=5 WHERE name='se'");
12
    $dbh->do("UPDATE search_field SET facet_order=6 WHERE name='subject'");
13
    $dbh->do("UPDATE search_field SET facet_order=7 WHERE name='ccode'");
14
    $dbh->do("UPDATE search_field SET facet_order=8 WHERE name='holdingbranch'");
15
    $dbh->do("UPDATE search_field SET facet_order=9 WHERE name='homebranch'");
16
17
    # Always end with this (adjust the bug info)
18
    SetVersion( $DBversion );
19
    print "Upgrade to $DBversion done (Bug 18235 - Elastic search - make facets configurable)\n";
20
}
(-)a/installer/data/mysql/atomicupdate/bug_18235-add-search_field-facet_order.sql (-11 lines)
Lines 1-10 Link Here
1
ALTER TABLE search_field ADD COLUMN facet_order TINYINT(4) DEFAULT NULL AFTER weight;
2
UPDATE search_field SET facet_order=1 WHERE name='author';
3
UPDATE search_field SET facet_order=2 WHERE name='itype';
4
UPDATE search_field SET facet_order=3 WHERE name='location';
5
UPDATE search_field SET facet_order=4 WHERE name='su-geo';
6
UPDATE search_field SET facet_order=5 WHERE name='se';
7
UPDATE search_field SET facet_order=6 WHERE name='subject';
8
UPDATE search_field SET facet_order=7 WHERE name='ccode';
9
UPDATE search_field SET facet_order=8 WHERE name='holdingbranch';
10
UPDATE search_field SET facet_order=9 WHERE name='homebranch';
11
- 

Return to bug 18235