Bug 27808: DB changes - adjust items.onloan when needed

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit bb2758839e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 79ef9d3be8)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
This commit is contained in:
Jonathan Druart 2021-03-01 13:34:56 +01:00 committed by Andrew Fuerste-Henry
parent e22376c7e9
commit bf4ec40c6f
1 changed files with 12 additions and 0 deletions

View File

@ -0,0 +1,12 @@
$DBversion = 'XXX'; # will be replaced by the RM
if( CheckVersion( $DBversion ) ) {
$dbh->do(q|
UPDATE items
LEFT JOIN issues ON issues.itemnumber=items.itemnumber
SET items.onloan=CAST(issues.date_due AS DATE)
WHERE items.onloan IS NULL
|);
NewVersion( $DBversion, 27808, "Adjust items.onloan if needed");
}