[Koha-patches] [PATCH] [SIGNED-OFF] Bug 6428 Follow up: db rev for coded_location_qualifier

Marcel de Rooy M.de.Rooy at rijksmuseum.nl
Thu Aug 4 10:54:37 CEST 2011


From: James, Mason <mtj at kohaaloha.com>

Clears kohafield for 952f (items.coded_location_qualifier).

Signed-off-by: Marcel de Rooy <m.de.rooy at rijksmuseum.nl>
Corrected a typo that made the SQL statement fail (missing single quote before fieldname).
Tested it on 3.05.00.007. Will work. I already had this connection for 952f removed long ago. If it still would have been there, it will be gone now!
---
 installer/data/mysql/updatedatabase.pl |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl
index 2076edf..7f0223f 100755
--- a/installer/data/mysql/updatedatabase.pl
+++ b/installer/data/mysql/updatedatabase.pl
@@ -4391,6 +4391,13 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
     SetVersion($DBversion);
 }
 
+$DBversion = "3.05.00.xxx";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+    $dbh->do("UPDATE marc_subfield_structure SET kohafield = NULL WHERE tagfield = 952 AND tagsubfield = 'f' AND kohafield = 'items.coded_location_qualifier'");
+    print "Upgrade to $DBversion done (remove non-existant 'items.coded_location_qualifier' column)\n";
+    SetVersion($DBversion);
+}
+
 =head1 FUNCTIONS
 
 =head2 DropAllForeignKeys($table)
-- 
1.6.0.6



More information about the Koha-patches mailing list