Bug 30572

Summary: Field search_marc_to_field.sort needs syncing too
Product: Koha Reporter: Marcel de Rooy <m.de.rooy>
Component: DatabaseAssignee: Marcel de Rooy <m.de.rooy>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: kyle, martin.renvoize, victor
Version: master   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Martin Renvoize Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.05.00,21.11.06
Bug Depends on:    
Bug Blocks: 30486, 34740    
Attachments: Bug 30572: Adjust search_marc_to_field.sort in kohastructure
Bug 30572: Dbrev for search_marc_to_field.sort
Bug 30572: DBIx schema change for SearchMarcToField
Bug 30572: Adjust search_marc_to_field.sort in kohastructure
Bug 30572: Dbrev for search_marc_to_field.sort
Bug 30572: DBIx schema change for SearchMarcToField
Bug 30572: (QA follow-up) Fix failing unit test

Description Marcel de Rooy 2022-04-20 14:56:30 UTC
$DBversion = '20.11.03.003';
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'" );

kohastructure:

CREATE TABLE `search_marc_to_field` (
  `sort` tinyint(1) DEFAULT NULL COMMENT 'true/false creates special sort handling, null doesn''t',
Comment 1 Marcel de Rooy 2022-04-21 12:52:01 UTC
Created attachment 133552 [details] [review]
Bug 30572: Adjust search_marc_to_field.sort in kohastructure

Test plan:
New install or run kohastructure on empty database.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 2 Marcel de Rooy 2022-04-21 12:52:05 UTC
Created attachment 133553 [details] [review]
Bug 30572: Dbrev for search_marc_to_field.sort

Test plan:
Run updatedatabase.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 3 Marcel de Rooy 2022-04-21 12:52:09 UTC
Created attachment 133554 [details] [review]
Bug 30572: DBIx schema change for SearchMarcToField

No test plan.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 4 Marcel de Rooy 2022-04-21 12:53:12 UTC
Trivial: self SO
Comment 5 Martin Renvoize 2022-04-26 13:15:30 UTC
Created attachment 133892 [details] [review]
Bug 30572: Adjust search_marc_to_field.sort in kohastructure

Test plan:
New install or run kohastructure on empty database.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 6 Martin Renvoize 2022-04-26 13:15:34 UTC
Created attachment 133893 [details] [review]
Bug 30572: Dbrev for search_marc_to_field.sort

Test plan:
Run updatedatabase.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 7 Martin Renvoize 2022-04-26 13:15:38 UTC
Created attachment 133894 [details] [review]
Bug 30572: DBIx schema change for SearchMarcToField

No test plan.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 8 Martin Renvoize 2022-04-26 13:16:01 UTC
Works well, PQA
Comment 9 Fridolin Somers 2022-05-02 21:25:35 UTC
Pushed to master for 22.05, thanks to everybody involved 🦄
Comment 10 Martin Renvoize 2022-05-05 16:09:47 UTC
This leads to failures on t/db_dependent/Koha/SearchEngine/Elasticsearch/ExportConfig.t
Comment 11 Martin Renvoize 2022-05-05 16:13:53 UTC
Created attachment 134655 [details] [review]
Bug 30572: (QA follow-up) Fix failing unit test

We changed from 'null' being meainingful to using a tinyint and
explicitly requiring '0'.  This patch simply updates the unit test to
reflect that change.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 12 Martin Renvoize 2022-05-05 16:14:35 UTC
Follow-up pushed to master, lets turn Jenkins green!
Comment 13 Kyle M Hall 2022-05-06 18:01:21 UTC
Pushed to 21.11.x for 21.11.06
Comment 14 Victor Grousset/tuxayo 2022-06-23 01:43:51 UTC
Not backported to oldoldstable (21.05.x). Feel free to ask if it's needed.
Comment 15 Martin Renvoize 2022-06-23 13:44:56 UTC
Another background thing, Not documentation changes required.