[Patches] [PATCH] 6536: Z3950 Enhancements (DB Revision)

koha-patchbot at kohaaloha.com koha-patchbot at kohaaloha.com
Thu Dec 22 01:40:03 NZDT 2011


From: Marcel de Rooy <m.de.rooy at rijksmuseum.nl>
Date: Thu, 30 Jun 2011 09:34:23 +0200
Subject: [PATCH] 6536: Z3950 Enhancements (DB Revision)
Content-Type: text/plain; charset="utf-8"

This patch contains db revision for Z3950 enhancements: SRU search targets, MARC conversion and additional XSLT processing.

August 11, 2011: Rebased. Removed changes for different XXX handling (see Bugzilla 6700).
December 21, 2011: Rebased.
---
 installer/data/mysql/kohastructure.sql |   10 ++++++----
 installer/data/mysql/updatedatabase.pl |   12 ++++++++++++
 2 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql
index a03bd23..c1e7e5d 100644
--- a/installer/data/mysql/kohastructure.sql
+++ b/installer/data/mysql/kohastructure.sql
@@ -2007,21 +2007,23 @@ CREATE TABLE `virtualshelfcontents` ( -- information about the titles in a list
 
 DROP TABLE IF EXISTS `z3950servers`;
 CREATE TABLE `z3950servers` ( -- connection information for the Z39.50 targets used in cataloging
-  `host` varchar(255) default NULL, -- target's host name
+  `host` varchar(255) NOT NULL, -- target's host name
   `port` int(11) default NULL, -- port number used to connect to target
   `db` varchar(255) default NULL, -- target's database name
   `userid` varchar(255) default NULL, -- username needed to log in to target
   `password` varchar(255) default NULL, -- password needed to log in to target
-  `name` mediumtext, -- name given to the target by the library
+  `name` mediumtext NOT NULL, -- name given to the target by the library
   `id` int(11) NOT NULL auto_increment, -- unique identifier assigned by Koha
   `checked` smallint(6) default NULL, -- whether this target is checked by default  (1 for yes, 0 for no)
   `rank` int(11) default NULL, -- where this target appears in the list of targets
-  `syntax` varchar(80) default NULL, -- marc format provided by this target
+  `syntax` varchar(80) NOT NULL, -- marc format provided by this target
   `icon` text, -- unused in Koha
   `position` enum('primary','secondary','') NOT NULL default 'primary',
   `type` enum('zed','opensearch') NOT NULL default 'zed',
-  `encoding` text default NULL, -- characters encoding provided by this target
+  `encoding` text NOT NULL, -- characters encoding provided by this target
   `description` text NOT NULL, -- unused in Koha
+  `srufields` text, -- list for matching Koha search fields with sru indexes
+  `add_xslt` varchar(255), -- name of optional xslt transformation to apply
   PRIMARY KEY  (`id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl
index 0063a75..6f8f671 100755
--- a/installer/data/mysql/updatedatabase.pl
+++ b/installer/data/mysql/updatedatabase.pl
@@ -4578,6 +4578,18 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
     SetVersion($DBversion);
 }
 
+$DBversion = "3.06.XX.XXX"; #FIXME
+if(C4::Context->preference("Version") lt TransformToNum($DBversion)) {
+  $dbh->do("ALTER TABLE z3950servers MODIFY COLUMN `host` varchar(255) NOT NULL;");
+  $dbh->do("ALTER TABLE z3950servers MODIFY COLUMN `name` mediumtext NOT NULL;");
+  $dbh->do("ALTER TABLE z3950servers MODIFY COLUMN `syntax` varchar(80) NOT NULL;");
+  $dbh->do("ALTER TABLE z3950servers MODIFY COLUMN `encoding` text NOT NULL;");
+  $dbh->do("ALTER TABLE z3950servers ADD COLUMN `srufields` text;");
+  $dbh->do("ALTER TABLE z3950servers ADD COLUMN `add_xslt` varchar(255);");
+  print "Upgrade to $DBversion done (Bug 6536: Z3950 enhancements)\n";
+  #SetVersion ($DBversion); #FIXME
+}
+
 =head1 FUNCTIONS
 
 =head2 DropAllForeignKeys($table)
-- 
1.6.0.6




More information about the Patches mailing list