Bug 19790: Add a db revision for existing installs
authorMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Mon, 11 Dec 2017 09:09:00 +0000 (10:09 +0100)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 12 Feb 2018 21:02:03 +0000 (18:02 -0300)
Since many installs may still have the additionalauthors kohafield,
this patch adds a dbrev in atomicupdate to clear it.

Test plan:
[1] Run updatedatabase. Check that you see no additionalauthors anymore
    in marc_subfield_structure.kohafield.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Charles Farmer <charles.farmer@inLibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
installer/data/mysql/atomicupdate/bug19790.perl [new file with mode: 0644]

diff --git a/installer/data/mysql/atomicupdate/bug19790.perl b/installer/data/mysql/atomicupdate/bug19790.perl
new file mode 100644 (file)
index 0000000..1943d33
--- /dev/null
@@ -0,0 +1,6 @@
+$DBversion = 'XXX';  # will be replaced by the RM
+if( CheckVersion( $DBversion ) ) {
+    $dbh->do( "UPDATE marc_subfield_structure SET kohafield=NULL where kohafield='additionalauthors.author'" );
+    SetVersion( $DBversion );
+    print "Upgrade to $DBversion done (Bug 19790 - Remove additionalauthors.author from installer files)\n";
+}