From 84f980971abd65f76ce7f7515c2e5b196ba068e8 Mon Sep 17 00:00:00 2001 From: Ere Maijala Date: Tue, 23 Jan 2018 15:46:25 +0200 Subject: [PATCH] Bug 20073: Add database and mappings UI support for isbn and stdno field types. --- installer/data/mysql/atomicupdate/bug_20073.perl | 8 ++++++++ installer/data/mysql/kohastructure.sql | 2 +- .../modules/admin/searchengine/elasticsearch/mappings.tt | 14 +++++++++++++- 3 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/bug_20073.perl diff --git a/installer/data/mysql/atomicupdate/bug_20073.perl b/installer/data/mysql/atomicupdate/bug_20073.perl new file mode 100644 index 0000000..0fd4b45 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_20073.perl @@ -0,0 +1,8 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + $dbh->do( "ALTER TABLE search_field CHANGE COLUMN type 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'" ); + + # Always end with this (adjust the bug info) + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 20073 - Add new types for Elasticsearch fields)\n"; +} diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index f031503..204e1b4 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -1483,7 +1483,7 @@ CREATE TABLE `search_field` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL COMMENT 'the name of the field as it will be stored in the search engine', `label` varchar(255) NOT NULL COMMENT 'the human readable name of the field, for display', - `type` ENUM('', 'string', 'date', 'number', 'boolean', 'sum') NOT NULL COMMENT 'what type of data this holds, relevant when storing it in the search engine', + `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', PRIMARY KEY (`id`), UNIQUE KEY (`name`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/searchengine/elasticsearch/mappings.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/searchengine/elasticsearch/mappings.tt index 4f406c0..b6b6aa2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/searchengine/elasticsearch/mappings.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/searchengine/elasticsearch/mappings.tt @@ -1,7 +1,9 @@ +[% USE Koha %] +[% SET KOHA_VERSION = Koha.Preference('Version') %] [% INCLUDE 'doc-head-open.inc' %] Koha › Administration › Elastic Search mappings [% INCLUDE 'doc-head-close.inc' %] - +