Bug 25867: Database update for changing existing frameworks
[koha.git] / installer / data / mysql / atomicupdate / bug_25867_location_renames.perl
diff --git a/installer/data/mysql/atomicupdate/bug_25867_location_renames.perl b/installer/data/mysql/atomicupdate/bug_25867_location_renames.perl
new file mode 100644 (file)
index 0000000..5a43e7e
--- /dev/null
@@ -0,0 +1,14 @@
+$DBversion = 'XXX'; # will be replaced by the RM
+if( CheckVersion( $DBversion ) ) {
+
+    $dbh->do( "UPDATE marc_subfield_structure SET liblibrarian = 'Home library' WHERE liblibrarian = 'Permanent location'
+        AND tagfield = 952 and tagsubfield = 'a'" );
+    $dbh->do( "UPDATE marc_subfield_structure SET libopac = 'Home library' WHERE libopac = 'Permanent location'
+        AND tagfield = 952 and tagsubfield = 'a'" );
+    $dbh->do( "UPDATE marc_subfield_structure SET liblibrarian = 'Current library' WHERE liblibrarian = 'Current location'
+        AND tagfield = 952 and tagsubfield = 'b'" );
+    $dbh->do( "UPDATE marc_subfield_structure SET libopac = 'Current library' WHERE libopac = 'Current location'
+        AND tagfield = 952 and tagsubfield = 'b'" );
+
+    NewVersion( $DBversion, 25867, "Update subfield descriptions for 952\$a and 952\$b");
+}