From 2afab02fde8c9c7a2f26c626c7684508287c976e Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 27 Jan 2021 10:22:27 +0100 Subject: [PATCH] Bug 27530: Set correct dateofbirth for 'C' Categories B, J, K and YA have a upper age limit of 17 years. We are setting the dateofbirth to today - 15 years to prevent juvenils to be 70! Note that DATE_SUB is a MySQLism, but there is no way to be portable here. Signed-off-by: Nick Clemens Signed-off-by: Katrin Fischer Signed-off-by: Jonathan Druart (cherry picked from commit b647aff01d504533a5a3720c66e6adcf0067792f) Signed-off-by: Fridolin Somers (cherry picked from commit 23dd20a9ced86e29ec37d01ade23eda92bb161b0) --- installer/data/mysql/en/optional/sample_patrons.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/installer/data/mysql/en/optional/sample_patrons.yml b/installer/data/mysql/en/optional/sample_patrons.yml index a7baf0d38a..c68b75e58f 100644 --- a/installer/data/mysql/en/optional/sample_patrons.yml +++ b/installer/data/mysql/en/optional/sample_patrons.yml @@ -2424,3 +2424,6 @@ tables: flags: ~ sort1: 0.91641750830823 sort2: 0.27291712562825 + +sql_statements: + - "UPDATE borrowers SET dateofbirth=DATE_SUB(CAST(NOW() AS DATE), INTERVAL 15 YEAR) WHERE categorycode IN ('B', 'J', 'K', 'YA');" -- 2.20.1