Bug 27153: DB Updates
We start by adding the field to the table It is possible a library would want two versions of the same field in the indexing. We need to make the filter part of the primary key in order to allow this Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
parent
3c319d988c
commit
333109c7fd
2 changed files with 32 additions and 0 deletions
31
installer/data/mysql/atomicupdate/bug_27153.pl
Executable file
31
installer/data/mysql/atomicupdate/bug_27153.pl
Executable file
|
@ -0,0 +1,31 @@
|
|||
use Modern::Perl;
|
||||
|
||||
return {
|
||||
bug_number => "27153",
|
||||
description => "Add option to filter search fields",
|
||||
up => sub {
|
||||
my ($args) = @_;
|
||||
my ( $dbh, $out ) = @$args{qw(dbh out)};
|
||||
|
||||
unless ( column_exists( 'search_marc_to_field', 'filter' ) ) {
|
||||
$dbh->do(
|
||||
q{
|
||||
ALTER TABLE search_marc_to_field
|
||||
ADD filter varchar(100) NOT NULL DEFAULT '' COMMENT 'specify a filter to be applied to field'
|
||||
AFTER search
|
||||
}
|
||||
);
|
||||
say $out "Added column 'search_marc_to_field.filter'";
|
||||
}
|
||||
unless ( primary_key_exists( 'search_marc_to_field', 'filter' ) ) {
|
||||
$dbh->do(
|
||||
q{
|
||||
ALTER TABLE search_marc_to_field
|
||||
DROP PRIMARY KEY,
|
||||
ADD PRIMARY KEY (search_marc_map_id,search_field_id,filter)
|
||||
}
|
||||
);
|
||||
say $out "Updated primary key to include filter";
|
||||
}
|
||||
},
|
||||
};
|
|
@ -5392,6 +5392,7 @@ DROP TABLE IF EXISTS `search_marc_to_field`;
|
|||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `search_marc_to_field` (
|
||||
`search` tinyint(1) NOT NULL DEFAULT 1,
|
||||
`filter` varchar(100) NOT NULL DEFAULT '' COMMENT 'specify a filter to be applied to field',
|
||||
`search_marc_map_id` int(11) NOT NULL,
|
||||
`search_field_id` int(11) NOT NULL,
|
||||
`facet` tinyint(1) DEFAULT 0 COMMENT 'true if a facet field should be generated for this',
|
||||
|
|
Loading…
Reference in a new issue