Bug 10215: (follow-up) Correct existing data
authorMartin Renvoize <martin.renvoize@ptfs-europe.com>
Wed, 5 Jun 2019 11:54:30 +0000 (12:54 +0100)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Thu, 6 Jun 2019 14:27:00 +0000 (15:27 +0100)
This patch adds the correction of data ('' => NULL) during the DB
update.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

installer/data/mysql/atomicupdate/bug_10215.perl

index a960435..1358cdf 100644 (file)
@@ -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";
 }