From cfbae75b07d1717577b98ffc9262f36daef0fb22 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 1 Mar 2021 13:34:56 +0100 Subject: [PATCH] Bug 27808: DB changes - adjust items.onloan when needed Signed-off-by: Kyle M Hall --- installer/data/mysql/atomicupdate/bug_27808.perl | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/bug_27808.perl diff --git a/installer/data/mysql/atomicupdate/bug_27808.perl b/installer/data/mysql/atomicupdate/bug_27808.perl new file mode 100644 index 0000000000..0cf95a5158 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_27808.perl @@ -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"); +} -- 2.24.1 (Apple Git-126)