When upgrading from Koha 3.22 to 18.11, the DB update process (updatedatabase.pl) fails with the following error message : DBD::mysql::st execute failed: Unknown column 'me.weight' in 'field list' [for Statement "SELECT `me`.`id`, `me`.`name`, `me`.`label`, `me`.`type`, `me`.`weight` FROM `search_field` `me` WHERE ( `me`.`name` = ? )" with ParamValues: 0='suppress'] at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1836. DBIx::Class::Storage::DBI::_dbh_execute(): Unknown column 'me.weight' in 'field list' at /.../Koha/Objects.pm line 110
Created attachment 82822 [details] Fix updatedatabase.pl
Created attachment 83001 [details] [review] Bug 21931: Do not reset the ES mapping on 3.23.00.050 This update DB entry uses DBIx schema which does not make it crashes if the table structure is changed. Which happens on 18.06.00.054, that added search_field.weight The entry 3.23.00.050 fails with Unknown column 'me.weight' in 'field list' This patch removes the reset of the mapping and display a warning to tell the administrator the mapping must be reset/inserted Test plan: Use a 3.22 dump and upgrade it
Hi Alex, Thanks for reporting it. I have proposed another approach: remove the reset of the ES mappings. It will make it more robust as it will not explode in the future if the table structure changed again. Do not forget to change the status when you submit a patch that is ready to be tested.
Created attachment 83166 [details] [review] Bug 21931: Do not reset the ES mapping on 3.23.00.050 This update DB entry uses DBIx schema which does not make it crashes if the table structure is changed. Which happens on 18.06.00.054, that added search_field.weight The entry 3.23.00.050 fails with Unknown column 'me.weight' in 'field list' This patch removes the reset of the mapping and display a warning to tell the administrator the mapping must be reset/inserted Test plan: Use a 3.22 dump and upgrade it Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 83171 [details] [review] Bug 21931: Do not reset the ES mapping on 3.23.00.050 This update DB entry uses DBIx schema which does not make it crashes if the table structure is changed. Which happens on 18.06.00.054, that added search_field.weight The entry 3.23.00.050 fails with Unknown column 'me.weight' in 'field list' This patch removes the reset of the mapping and display a warning to tell the administrator the mapping must be reset/inserted Test plan: Use a 3.22 dump and upgrade it Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Passing QA here.. a sound fix.
Awesome work all! Pushed to master for 19.05
Pushed to 18.11.x for 18.11.01
backported to 18.05 for 18.05.08
Pushed to 17.11.x for 17.11.14