View | Details | Raw Unified | Return to bug 6536
Collapse All | Expand All

(-)a/installer/data/mysql/kohastructure.sql (-7 / +7 lines)
Lines 2334-2356 CREATE TABLE `virtualshelfshares` ( -- shared private lists Link Here
2334
2334
2335
DROP TABLE IF EXISTS `z3950servers`;
2335
DROP TABLE IF EXISTS `z3950servers`;
2336
CREATE TABLE `z3950servers` ( -- connection information for the Z39.50 targets used in cataloging
2336
CREATE TABLE `z3950servers` ( -- connection information for the Z39.50 targets used in cataloging
2337
  `id` int(11) NOT NULL auto_increment, -- unique identifier assigned by Koha
2337
  `host` varchar(255) default NULL, -- target's host name
2338
  `host` varchar(255) default NULL, -- target's host name
2338
  `port` int(11) default NULL, -- port number used to connect to target
2339
  `port` int(11) default NULL, -- port number used to connect to target
2339
  `db` varchar(255) default NULL, -- target's database name
2340
  `db` varchar(255) default NULL, -- target's database name
2340
  `userid` varchar(255) default NULL, -- username needed to log in to target
2341
  `userid` varchar(255) default NULL, -- username needed to log in to target
2341
  `password` varchar(255) default NULL, -- password needed to log in to target
2342
  `password` varchar(255) default NULL, -- password needed to log in to target
2342
  `name` mediumtext, -- name given to the target by the library
2343
  `servername` mediumtext NOT NULL, -- name given to the target by the library
2343
  `id` int(11) NOT NULL auto_increment, -- unique identifier assigned by Koha
2344
  `checked` smallint(6) default NULL, -- whether this target is checked by default  (1 for yes, 0 for no)
2344
  `checked` smallint(6) default NULL, -- whether this target is checked by default  (1 for yes, 0 for no)
2345
  `rank` int(11) default NULL, -- where this target appears in the list of targets
2345
  `rank` int(11) default NULL, -- where this target appears in the list of targets
2346
  `syntax` varchar(80) default NULL, -- marc format provided by this target
2346
  `syntax` varchar(80) default NULL, -- marc format provided by this target
2347
  `timeout` int(11) NOT NULL DEFAULT '0', -- number of seconds before Koha stops trying to access this server
2347
  `timeout` int(11) NOT NULL DEFAULT '0', -- number of seconds before Koha stops trying to access this server
2348
  `icon` text, -- unused in Koha
2348
  `servertype` enum('zed','sru') NOT NULL default 'zed', -- zed means z39.50 server
2349
  `position` enum('primary','secondary','') NOT NULL default 'primary',
2350
  `type` enum('zed','opensearch') NOT NULL default 'zed',
2351
  `encoding` text default NULL, -- characters encoding provided by this target
2349
  `encoding` text default NULL, -- characters encoding provided by this target
2352
  `description` text NOT NULL, -- unused in Koha
2350
  `recordtype` enum('authority','biblio') NOT NULL default 'biblio', -- server contains bibliographic or authority records
2353
  `recordtype` varchar(45) NOT NULL default 'biblio', -- server contains bibliographic or authority records
2351
  `sru_options` varchar(255) default NULL, -- options like sru=get, sru_version=1.1; will be passed to the server via ZOOM
2352
  `sru_fields` mediumtext default NULL, -- contains the mapping between the Z3950 search fields and the specific SRU server indexes
2353
  `add_xslt` mediumtext default NULL, -- zero or more paths to XSLT files to be processed on the search results
2354
  PRIMARY KEY  (`id`)
2354
  PRIMARY KEY  (`id`)
2355
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2355
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2356
2356
(-)a/installer/data/mysql/updatedatabase.pl (-1 / +29 lines)
Lines 8570-8575 if ( CheckVersion($DBversion) ) { Link Here
8570
    SetVersion($DBversion);
8570
    SetVersion($DBversion);
8571
}
8571
}
8572
8572
8573
8574
$DBversion = "3.17.00.XXX";
8575
if ( CheckVersion($DBversion) ) {
8576
    # Correct invalid recordtypes (should be very exceptional)
8577
    $dbh->do(q{
8578
        UPDATE z3950servers set recordtype='biblio' WHERE recordtype NOT IN ('authority','biblio')
8579
    });
8580
    # Correct invalid server types (should also be very exceptional)
8581
    $dbh->do(q{
8582
        UPDATE z3950servers set type='zed' WHERE type <> 'zed'
8583
    });
8584
    # Adjust table
8585
    $dbh->do(q{
8586
        ALTER TABLE z3950servers
8587
        DROP COLUMN icon,
8588
        DROP COLUMN description,
8589
        DROP COLUMN position,
8590
        MODIFY COLUMN id int NOT NULL AUTO_INCREMENT FIRST,
8591
        MODIFY COLUMN recordtype enum('authority','biblio') NOT NULL DEFAULT 'biblio',
8592
        CHANGE COLUMN name servername mediumtext NOT NULL,
8593
        CHANGE COLUMN type servertype enum('zed','sru') NOT NULL DEFAULT 'zed',
8594
        ADD COLUMN sru_options varchar(255) default NULL,
8595
        ADD COLUMN sru_fields mediumtext default NULL,
8596
        ADD COLUMN add_xslt mediumtext default NULL
8597
    });
8598
    print "Upgrade to $DBversion done (Bug 6536: Z3950 improvements)\n";
8599
    SetVersion ($DBversion);
8600
}
8601
8573
=head1 FUNCTIONS
8602
=head1 FUNCTIONS
8574
8603
8575
=head2 TableExists($table)
8604
=head2 TableExists($table)
8576
- 

Return to bug 6536