Bug 22518: Add database update 'just in case'
authorMartin Renvoize <martin.renvoize@ptfs-europe.com>
Fri, 15 Mar 2019 13:43:03 +0000 (13:43 +0000)
committerNick Clemens <nick@bywatersolutions.com>
Fri, 29 Mar 2019 11:38:12 +0000 (11:38 +0000)
All cases I could find where 'O' was referenced it was referenced
alongside 'FU'.. as such I've written this DB update to case any last
cases of 'O' and update them to 'FU' "just in case"

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

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

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

installer/data/mysql/atomicupdate/bug_22518.perl [new file with mode: 0644]

diff --git a/installer/data/mysql/atomicupdate/bug_22518.perl b/installer/data/mysql/atomicupdate/bug_22518.perl
new file mode 100644 (file)
index 0000000..4d975d9
--- /dev/null
@@ -0,0 +1,16 @@
+$DBversion = 'XXX';    # will be replaced by the RM
+if ( CheckVersion($DBversion) ) {
+
+        $dbh->do(
+            qq{
+            UPDATE `accountlines`
+            SET
+              `accounttype` = 'FU'
+            WHERE
+              `accounttype` = 'O'
+          }
+        );
+
+    SetVersion($DBversion);
+    print "Upgrade to $DBversion done (Bug 22518 - Fix accounttype 'O' to 'FU')\n";
+}