From e9e3ce36ed74ab6e2de7520f1f4d179b8d7292a1 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 22 Jan 2018 16:31:28 -0300 Subject: [PATCH] Bug 19963: Update 3.21.00.033 to drop ethnicity data if '' --- installer/data/mysql/updatedatabase.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 57a1a00c47..4fb60d34f1 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -11061,14 +11061,14 @@ if ( CheckVersion($DBversion) ) { my $count_borrower_modifications = $dbh->selectrow_arrayref(q| SELECT COUNT(*) FROM borrower_modifications - WHERE ethnicity IS NOT NULL - OR ethnotes IS NOT NULL + WHERE ( ethnicity IS NOT NULL AND ethnicity == "" ) + OR ( ethnotes IS NOT NULL AND ethnotes == "" ) |); my $count_borrowers = $dbh->selectrow_arrayref(q| SELECT COUNT(*) FROM borrowers - WHERE ethnicity IS NOT NULL - OR ethnotes IS NOT NULL + WHERE ( ethnicity IS NOT NULL AND ethnicity == "" ) + OR ( ethnotes IS NOT NULL AND ethnotes == "" ) |); # We don't care about the ethnicity of the deleted borrowers, right? if ( $count_ethnicity->[0] == 0 -- 2.11.0