From b904f8aff07373f1c6353bc2318e1cc96c008df4 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 --- 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.20.1