Browse Source
This patch changes the interface to remove the undef option We also update existing mappings and set default of 1 Comment previously indicated undef was treated differently, but in the code we treat undef as 1 That code is untoched to avoid creating problems for older mappings that may be reloaded To test: 1 - View the ES mappings, note you can set columns to Undef, 0, 1 2 - Set some to undef 3 - Apply patches 4 - Update database 5 - Undef now show as 'Yes' 6 - Confirm you can set columns as Yes/no 7 - Confirm that mandatory columns display correct value when readonly (see issues field) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>21.05.x
2 changed files with 15 additions and 13 deletions
@ -0,0 +1,6 @@ |
|||||
|
$DBversion = 'XXX'; |
||||
|
if( CheckVersion( $DBversion ) ) { |
||||
|
$dbh->do( "UPDATE search_marc_to_field SET sort = 1 WHERE sort IS NULL" ); |
||||
|
$dbh->do( "ALTER TABLE search_marc_to_field MODIFY COLUMN sort tinyint(1) DEFAULT 1 NOT NULL COMMENT 'Sort defaults to 1 (Yes) and creates sort fields in the index, 0 (no) will prevent this'" ); |
||||
|
NewVersion( $DBversion, 27316, "In Elastisearch mappings convert NULL (Undef) for sort to 1 (Yes)"); |
||||
|
} |
Loading…
Reference in new issue