@@ -, +, @@ --- .../atomicupdate/bug_19482_add_mandatory_field_to_mapping.perl | 10 ++++++++++ installer/data/mysql/kohastructure.sql | 1 + 2 files changed, 11 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/bug_19482_add_mandatory_field_to_mapping.perl --- a/installer/data/mysql/atomicupdate/bug_19482_add_mandatory_field_to_mapping.perl +++ a/installer/data/mysql/atomicupdate/bug_19482_add_mandatory_field_to_mapping.perl @@ -0,0 +1,10 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + + if( !column_exists( 'search_field', 'mandatory' ) ) { + $dbh->do( "ALTER TABLE search_field ADD COLUMN mandatory tinyint(1) NULL DEFAULT NULL" ); + } + + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 19482 - Add mandatory column to search_field for ES mapping)\n"; +} --- a/installer/data/mysql/kohastructure.sql +++ a/installer/data/mysql/kohastructure.sql @@ -1396,6 +1396,7 @@ 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', + `mandatory` tinyint(1) NULL DEFAULT NULL COMMENT 'if marked this field is not editable or removable', PRIMARY KEY (`id`), UNIQUE KEY (`name` (191)) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; --