From 3227e5ae443a5aefaeed84554ddd7c4f19f1205a Mon Sep 17 00:00:00 2001 From: David Gustafsson Date: Mon, 30 Sep 2019 15:15:35 +0200 Subject: [PATCH] Bug 20589: DBRev 19.06.00.032 Signed-off-by: Nick Clemens Signed-off-by: Alex Arnaud Signed-off-by: Martin Renvoize --- Koha.pm | 2 +- Koha/Schema/Result/SearchField.pm | 20 ++++++++++++++++++-- Koha/Schema/Result/SearchMarcToField.pm | 12 ++++++++++-- installer/data/mysql/kohastructure.sql | 3 +++ installer/data/mysql/updatedatabase.pl | 23 +++++++++++++++++++++++ 5 files changed, 55 insertions(+), 5 deletions(-) diff --git a/Koha.pm b/Koha.pm index e6e92deb03..2304bc46ad 100644 --- a/Koha.pm +++ b/Koha.pm @@ -29,7 +29,7 @@ use vars qw{ $VERSION }; # - #4 : the developer version. The 4th number is the database subversion. # used by developers when the database changes. updatedatabase take care of the changes itself # and is automatically called by Auth.pm when needed. -$VERSION = "19.06.00.031"; +$VERSION = "19.06.00.032"; sub version { return $VERSION; diff --git a/Koha/Schema/Result/SearchField.pm b/Koha/Schema/Result/SearchField.pm index a347da08bb..540d984274 100644 --- a/Koha/Schema/Result/SearchField.pm +++ b/Koha/Schema/Result/SearchField.pm @@ -66,6 +66,18 @@ what type of data this holds, relevant when storing it in the search engine the order place of the field in facet list if faceted +=head2 staff_client + + data_type: 'tinyint' + default_value: 1 + is_nullable: 0 + +=head2 opac + + data_type: 'tinyint' + default_value: 1 + is_nullable: 0 + =cut __PACKAGE__->add_columns( @@ -87,6 +99,10 @@ __PACKAGE__->add_columns( { data_type => "decimal", is_nullable => 1, size => [5, 2] }, "facet_order", { data_type => "tinyint", is_nullable => 1 }, + "staff_client", + { data_type => "tinyint", default_value => 1, is_nullable => 0 }, + "opac", + { data_type => "tinyint", default_value => 1, is_nullable => 0 }, ); =head1 PRIMARY KEY @@ -133,8 +149,8 @@ __PACKAGE__->has_many( ); -# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-03-28 15:31:40 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:4Hc7O2fMCses1Bgfmk6Anw +# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-10-02 12:47:22 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:EbUa4eprgxeUkoOUiXO/Cg __PACKAGE__->many_to_many("search_marc_maps", "search_marc_to_fields", "search_marc_map"); diff --git a/Koha/Schema/Result/SearchMarcToField.pm b/Koha/Schema/Result/SearchMarcToField.pm index bfd27eab48..01080160b9 100644 --- a/Koha/Schema/Result/SearchMarcToField.pm +++ b/Koha/Schema/Result/SearchMarcToField.pm @@ -23,6 +23,12 @@ __PACKAGE__->table("search_marc_to_field"); =head1 ACCESSORS +=head2 search + + data_type: 'tinyint' + default_value: 1 + is_nullable: 0 + =head2 search_marc_map_id data_type: 'integer' @@ -61,6 +67,8 @@ true/false creates special sort handling, null doesn't =cut __PACKAGE__->add_columns( + "search", + { data_type => "tinyint", default_value => 1, is_nullable => 0 }, "search_marc_map_id", { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, "search_field_id", @@ -120,8 +128,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07042 @ 2015-10-12 16:41:47 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ccnCYwDdtPGZ/VArAe1kPA +# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-10-02 12:47:22 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:9mqZ/zrii+Fv+k+eQNHYUw # You can replace this text with custom code or comments, and it will be preserved on regeneration diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 94c1c56a1a..7073c9a2d1 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -1396,6 +1396,8 @@ CREATE TABLE `search_field` ( `type` ENUM('', 'string', 'date', 'number', 'boolean', 'sum', 'isbn', 'stdno') NOT NULL COMMENT 'what type of data this holds, relevant when storing it in the search engine', `weight` decimal(5,2) DEFAULT NULL, `facet_order` TINYINT(4) DEFAULT NULL COMMENT 'the order place of the field in facet list if faceted', + `staff_client` tinyint(1) NOT NULL DEFAULT 1, + `opac` tinyint(1) NOT NULL DEFAULT 1, PRIMARY KEY (`id`), UNIQUE KEY (`name` (191)) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; @@ -1440,6 +1442,7 @@ CREATE TABLE `search_marc_map` ( DROP TABLE IF EXISTS search_marc_to_field; CREATE TABLE `search_marc_to_field` ( + search tinyint(1) NOT NULL DEFAULT 1, search_marc_map_id int(11) NOT NULL, search_field_id int(11) NOT NULL, facet boolean DEFAULT FALSE COMMENT 'true if a facet field should be generated for this', diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index a2c1ca13de..68c849b8a2 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -19555,6 +19555,29 @@ if( CheckVersion( $DBversion ) ) { print "Upgrade to $DBversion done (Bug 23566 - Add OPACDetailQRCode system preference)\n"; } +$DBversion = '19.06.00.032'; +if ( CheckVersion($DBversion) ) { + if ( !column_exists( 'search_marc_to_field', 'search' ) ) { + $dbh->do(q| + ALTER TABLE `search_marc_to_field` ADD COLUMN `search` tinyint(1) NOT NULL DEFAULT 1 + |); + } + if ( !column_exists( 'search_field', 'staff_client' ) ) { + $dbh->do(q| + ALTER TABLE `search_field` ADD COLUMN `staff_client` tinyint(1) NOT NULL DEFAULT 1 + |); + } + if ( !column_exists( 'search_field', 'opac' ) ) { + $dbh->do(q| + ALTER TABLE `search_field` ADD COLUMN `opac` tinyint(1) NOT NULL DEFAULT 1 + |); + } + + SetVersion($DBversion); + print +"Upgrade to $DBversion done (Bug 20589 - Add field boosting and use elastic query fields parameter instead of depricated _all)\n"; +} + # SEE bug 13068 # if there is anything in the atomicupdate, read and execute it. my $update_dir = C4::Context->config('intranetdir') . '/installer/data/mysql/atomicupdate/'; -- 2.39.5