From 2e1852fe79027390e91a3d95ed7a3776ee67c425 Mon Sep 17 00:00:00 2001 From: David Gustafsson Date: Mon, 30 Sep 2019 15:15:35 +0200 Subject: [PATCH] Bug 20589: DO NOT PUSH Schema changes Signed-off-by: Nick Clemens Signed-off-by: Alex Arnaud --- Koha/Schema/Result/SearchField.pm | 4 ++++ Koha/Schema/Result/SearchMarcToField.pm | 2 ++ .../data/mysql/atomicupdate/bug_20589_add_columns.perl | 14 ++++++++++++++ 3 files changed, 20 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/bug_20589_add_columns.perl diff --git a/Koha/Schema/Result/SearchField.pm b/Koha/Schema/Result/SearchField.pm index a347da0..3374905 100644 --- a/Koha/Schema/Result/SearchField.pm +++ b/Koha/Schema/Result/SearchField.pm @@ -87,6 +87,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", size => 1, is_nullable => 0, default => 1 }, + "opac", + { data_type => "tinyint", size => 1, is_nullable => 0, default => 1 }, ); =head1 PRIMARY KEY diff --git a/Koha/Schema/Result/SearchMarcToField.pm b/Koha/Schema/Result/SearchMarcToField.pm index bfd27ea..5f3ca05 100644 --- a/Koha/Schema/Result/SearchMarcToField.pm +++ b/Koha/Schema/Result/SearchMarcToField.pm @@ -71,6 +71,8 @@ __PACKAGE__->add_columns( { data_type => "tinyint", default_value => 0, is_nullable => 1 }, "sort", { data_type => "tinyint", is_nullable => 1 }, + "search", + { data_type => "tinyint", size => 1, is_nullable => 0, default => 1 }, ); =head1 PRIMARY KEY diff --git a/installer/data/mysql/atomicupdate/bug_20589_add_columns.perl b/installer/data/mysql/atomicupdate/bug_20589_add_columns.perl new file mode 100644 index 0000000..73ddd1b --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_20589_add_columns.perl @@ -0,0 +1,14 @@ +$DBversion = 'XXX'; +if (CheckVersion($DBversion)) { + if (!column_exists('search_marc_to_field', 'search')) { + $dbh->do("ALTER TABLE `search_marc_to_field` ADD COLUMN `search` tinyint(1) NOT NULL DEFAULT 1"); + } + if (!column_exists('search_field', 'staff_client')) { + $dbh->do("ALTER TABLE `search_field` ADD COLUMN `staff_client` tinyint(1) NOT NULL DEFAULT 1"); + } + if (!column_exists('search_field', 'opac')) { + $dbh->do("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"; -- 2.7.4