From cf95314cea642a78a655db01bba1a12099b8892d Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Wed, 5 Jun 2019 12:54:30 +0100 Subject: [PATCH] Bug 10215: (follow-up) Correct existing data This patch adds the correction of data ('' => NULL) during the DB update. Signed-off-by: Martin Renvoize --- installer/data/mysql/atomicupdate/bug_10215.perl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/installer/data/mysql/atomicupdate/bug_10215.perl b/installer/data/mysql/atomicupdate/bug_10215.perl index a960435a24..1358cdfb67 100644 --- a/installer/data/mysql/atomicupdate/bug_10215.perl +++ b/installer/data/mysql/atomicupdate/bug_10215.perl @@ -4,6 +4,9 @@ if ( CheckVersion($DBversion) ) { $dbh->do(q{ALTER TABLE subscriptionhistory CHANGE opacnote opacnote LONGTEXT NULL}); $dbh->do(q{ALTER TABLE subscriptionhistory CHANGE librariannote librariannote LONGTEXT NULL}); + $dbh->do(q{UPDATE subscriptionhistory SET opacnote = NULL WHERE opacnote = ''}); + $dbh->do(q{UPDATE subscriptionhistory SET librariannote = NULL WHERE librariannote = ''}); + SetVersion ($DBversion); print "Upgrade to $DBversion done (Bug 10215 - Increase the size of opacnote and librariannote for table subscriptionhistory)\n"; } -- 2.20.1