Bugzilla – Attachment 4541 Details for
Bug 6536
Z3950 Search Enhancements: SRU targets and additional XSLT processing
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch (db revision)
patch.txt (text/plain), 3.78 KB, created by
Marcel de Rooy
on 2011-06-30 13:04:24 UTC
(
hide
)
Description:
Patch (db revision)
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2011-06-30 13:04:24 UTC
Size:
3.78 KB
patch
obsolete
>From 450285b983a26a59a2435077b2e28b41cd1f5c0b Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@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. >It also contains a few additional lines of code for updatedatabase routines SetVersion and TransformToNum in order to facilitate testing new db revisions which are still marked XXX. >--- > installer/data/mysql/kohastructure.sql | 10 ++++++---- > installer/data/mysql/updatedatabase.pl | 20 +++++++++++++++++++- > 2 files changed, 25 insertions(+), 5 deletions(-) > >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index e3c6f42..1b0be0e 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -1985,21 +1985,23 @@ CREATE TABLE `virtualshelfcontents` ( > > DROP TABLE IF EXISTS `z3950servers`; > CREATE TABLE `z3950servers` ( >- `host` varchar(255) default NULL, >+ `host` varchar(255) NOT NULL, > `port` int(11) default NULL, > `db` varchar(255) default NULL, > `userid` varchar(255) default NULL, > `password` varchar(255) default NULL, >- `name` mediumtext, >+ `name` mediumtext NOT NULL, > `id` int(11) NOT NULL auto_increment, > `checked` smallint(6) default NULL, > `rank` int(11) default NULL, >- `syntax` varchar(80) default NULL, >+ `syntax` varchar(80) NOT NULL, > `icon` text, > `position` enum('primary','secondary','') NOT NULL default 'primary', > `type` enum('zed','opensearch') NOT NULL default 'zed', >- `encoding` text default NULL, >+ `encoding` text NOT NULL, > `description` text NOT NULL, >+ `srufields` text, >+ `add_xslt` varchar(255), > PRIMARY KEY (`id`) > ) ENGINE=InnoDB DEFAULT CHARSET=utf8; > >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 3c7d043..bbd8140 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -4354,6 +4354,18 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { > SetVersion ($DBversion); > } > >+$DBversion = "3.05.00.XXX"; >+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); >+} >+ > =head1 FUNCTIONS > > =head2 DropAllForeignKeys($table) >@@ -4396,6 +4408,10 @@ sub TransformToNum { > my $version = shift; > # remove the 3 last . to have a Perl number > $version =~ s/(.*\..*)\.(.*)\.(.*)/$1$2$3/; >+ # three X's at the end indicate that you are testing patch with dbrev >+ # change it into 999 >+ # prevents error on a < comparison between strings (should be: lt) >+ $version =~ s/XXX$/999/; > return $version; > } > >@@ -4406,7 +4422,9 @@ set the DBversion in the systempreferences > =cut > > sub SetVersion { >- my $kohaversion = TransformToNum(shift); >+ return if $_[0]=~ /XXX$/; >+ #you are testing a patch with a db revision; do not change version >+ my $kohaversion = TransformToNum($_[0]); > if (C4::Context->preference('Version')) { > my $finish=$dbh->prepare("UPDATE systempreferences SET value=? WHERE variable='Version'"); > $finish->execute($kohaversion); >-- >1.6.0.6 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 6536
:
4540
|
4541
|
4959
|
6901
|
6919
|
6920
|
6924
|
13462
|
26169
|
26170
|
26171
|
26172
|
29754
|
29755
|
29756
|
29779
|
29780
|
29788
|
29790
|
29791
|
29812
|
29813
|
29814
|
29815
|
29816
|
29817
|
29818
|
29819
|
30189
|
30190
|
30191
|
30192
|
30193
|
30194
|
30900
|
30901
|
30902
|
30903
|
30904
|
30905
|
30906
|
30907
|
30929
|
30930
|
30931
|
30932
|
30933
|
30934
|
30935
|
30936
|
31046
|
31048
|
31137
|
31193
|
31194
|
31195
|
31227
|
31247
|
31248
|
37264