Bug 27808: (QA follow-up) Make sure the update catches the items we want
authorTomas Cohen Arazi <tomascohen@theke.io>
Mon, 1 Mar 2021 14:56:23 +0000 (11:56 -0300)
committerAndrew Fuerste-Henry <andrew@bywatersolutions.com>
Sun, 14 Mar 2021 18:53:57 +0000 (18:53 +0000)
commit8f91dcda706261f538b33fe9aa1b866e19f1111a
tree789444511aaff89e93e91a7d4b23879b80836c44
parentc99cd7e77b9c2e8b9ea993ce0317b9535068123a
Bug 27808: (QA follow-up) Make sure the update catches the items we want

This query:

SELECT *
FROM items
LEFT JOIN issues
ON issues.itemnumber=items.itemnumber
WHERE items.onloan IS NULL;

returns 961 rows on the sample data, with 2 items checked out and onloan
set to NULL.

With this tweak, the query only matches the 2 checkout items with onloan
set to NULL:

SELECT *
FROM items
LEFT JOIN issues
ON issues.itemnumber=items.itemnumber
WHERE items.onloan IS NULL AND issues.issue_id IS NOT NULL;

This is the query that needs to be used on the atomic update for
filtering the items to be updated.

This patch does that.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 8df3e02885f94ef8a6f960f693c398b6646daf09)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 8a59b80e7e7cc812c2b1695e75c2020ba9bf3293)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
installer/data/mysql/updatedatabase.pl