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

(-)a/installer/data/mysql/atomicupdate/bug_27153.pl (+31 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number  => "27153",
5
    description => "Add option to filter search fields",
6
    up          => sub {
7
        my ($args) = @_;
8
        my ( $dbh, $out ) = @$args{qw(dbh out)};
9
10
        unless ( column_exists( 'search_marc_to_field', 'filter' ) ) {
11
            $dbh->do(
12
                q{
13
                ALTER TABLE search_marc_to_field
14
                ADD filter varchar(100) NOT NULL DEFAULT '' COMMENT 'specify a filter to be applied to field'
15
                AFTER search
16
            }
17
            );
18
            say $out "Added column 'search_marc_to_field.filter'";
19
        }
20
        unless ( primary_key_exists( 'search_marc_to_field', 'filter' ) ) {
21
            $dbh->do(
22
                q{
23
                ALTER TABLE search_marc_to_field
24
                DROP PRIMARY KEY,
25
                ADD PRIMARY KEY (search_marc_map_id,search_field_id,filter)
26
            }
27
            );
28
            say $out "Updated primary key to include filter";
29
        }
30
    },
31
};
(-)a/installer/data/mysql/kohastructure.sql (-1 / +1 lines)
Lines 5392-5397 DROP TABLE IF EXISTS `search_marc_to_field`; Link Here
5392
/*!40101 SET character_set_client = utf8 */;
5392
/*!40101 SET character_set_client = utf8 */;
5393
CREATE TABLE `search_marc_to_field` (
5393
CREATE TABLE `search_marc_to_field` (
5394
  `search` tinyint(1) NOT NULL DEFAULT 1,
5394
  `search` tinyint(1) NOT NULL DEFAULT 1,
5395
  `filter` varchar(100) NOT NULL DEFAULT '' COMMENT 'specify a filter to be applied to field',
5395
  `search_marc_map_id` int(11) NOT NULL,
5396
  `search_marc_map_id` int(11) NOT NULL,
5396
  `search_field_id` int(11) NOT NULL,
5397
  `search_field_id` int(11) NOT NULL,
5397
  `facet` tinyint(1) DEFAULT 0 COMMENT 'true if a facet field should be generated for this',
5398
  `facet` tinyint(1) DEFAULT 0 COMMENT 'true if a facet field should be generated for this',
5398
- 

Return to bug 27153