Bug 22521: Update existing accounttypes
authorMartin Renvoize <martin.renvoize@ptfs-europe.com>
Fri, 22 Mar 2019 11:46:36 +0000 (11:46 +0000)
committerNick Clemens <nick@bywatersolutions.com>
Wed, 17 Apr 2019 16:49:36 +0000 (16:49 +0000)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

installer/data/mysql/atomicupdate/bug_22521.perl

index d6d5acf..a631f41 100644 (file)
@@ -11,6 +11,35 @@ if ( CheckVersion($DBversion) ) {
         );
     }
 
+    $dbh->do(qq{
+        UPDATE
+          accountlines
+        SET
+          accounttype = 'OVERDUE',
+          status = 'UNRETURNED'
+        WHERE
+          accounttype = 'FU';
+    });
+
+    $dbh->do(qq{
+        UPDATE
+          accountlines
+        SET
+          accounttype = 'OVERDUE',
+          status = 'FORGIVEN'
+        WHERE
+          accounttype = 'FFOR';
+    });
+
+    $dbh->do(qq{
+        UPDATE
+          accountlines
+        SET
+          accounttype = 'OVERDUE',
+          status = 'RETURNED'
+        WHERE
+          accounttype = 'F';
+    });
     SetVersion($DBversion);
-    print "Upgrade to $DBversion done (Bug 22521 - Update accountlines.accounttype to varchar(16))\n";
+    print "Upgrade to $DBversion done (Bug 22521 - Update accountlines.accounttype to varchar(16), and map new statuses)\n";
 }